当前位置: 首页 > news >正文

DNS续集

1、DNS多域名解析

[root@dns ~]# vim /etc/named.rfc1912.zones
复制5行放在最后面
zone "z.a" IN {
        type master;
        file "z.a.zone";
        allow-update { none; };
};

zone "4.168.192.in-addr.arpa" IN {
        type master;
        file "10.1.1.zone";
        allow-update { none; };
};

zone "a.a" IN {
        type master;
        file "z.a.zone";
        allow-update { none; };
};

[root@dns ~]# vim /var/named/z.a.zone

[root@dns ~]# vim /etc/named.conf

对文件进行检查,查看是否有错误:
[root@dns ~]# named-checkconf /etc/named.rfc1912.zones
[root@dns ~]# named-checkconf /etc/named.conf
[root@dns ~]# named-checkzone /var/named/z.a.zone 

回到客户机进行访问测试:

2、时间同步服务器

[root@client ~]# date -s "2009-07-20 12:34:56"                更改时间
[root@client ~]# date
2009年 07月 20日 星期一 12:34:56 CST        
[root@client ~]# yum -y install ntpdate.x86_64                 下载时间软件
[root@client ~]# ntpdate cn.ntp.org.cn                                刷新时间
[root@client ~]# date

[root@ntp ~]# yum -y install ntp.x86_64
[root@ntp ~]# vim /etc/ntp.conf 
restrict 192.168.4.0 mask 255.255.255.0

[root@ntp ~]# ntpdate cn.ntp.org.cn
[root@ntp ~]# systemctl start ntpd
[root@ntp ~]# crontab -e                        设置每隔四小时同步一次的计划
* 4 * * * /usr/sbin/ntpdate cn.ntp.org.cn       

回到客户机         

[root@client ~]# date -s "2009-07-20 12:34:56"
2009年 07月 20日 星期一 12:34:56 CST
[root@client ~]# ntpdate 192.168.4.40
24 Jul 15:12:41 ntpdate[2488]: adjust time server 192.168.4.40 offset 0.037546 sec

[root@client ~]# date

2024年 07月 24日 星期三 14:30:08 CST

3、主从DNS


[root@sla ~]# hostnamectl set-hostname slva
[root@sla ~]# yum -y install ntp.x86_64 
[root@sla ~]# yum -y install ntpdate
[root@sla ~]# ntpdate 192.168.4.41
[root@sla ~]# yum -y install bind

[root@dns ~]# vim /etc/named.conf
allow-transfer  {192.168.4.41;};


[root@dns ~]# named-checkconf /etc/named.conf
[root@dns ~]# systemctl start named

[root@sla ~]# vim /etc/named.conf
13    listen-on port 53 { 127.0.0.1;any; };
 21    allow-query     { localhost;any; };
[root@sla ~]# vim /etc/named.rfc1912.zones    
zone "z.a" IN {
        type slave;
        file "slaves/z.a.zone";
        masters {192.168.4.33 ;};
};
要复制的话就ESC+要复制的行数(光标所在位置为第一行)+yy,找到要复制的位置点p,就复制好了。
[root@sla ~]# systemctl restart named
[root@sla ~]# ls -l /var/named/slaves/
总用量 4
-rw-r--r--. 1 named named 266 7月  24 16:03 z.a.zone
测试,打开客户端
[root@client ~]# echo "nameserver 192.168.4.33" > /etc/resolv.conf
[root@client ~]# nslookup www.z.a
Server:        192.168.4.33
Address:    192.168.4.33#53

Name:    www.z.a
Address: 192.168.4.31

[root@client ~]# echo "nameserver 192.168.4.41" > /etc/resolv.conf
[root@client ~]# nslookup www.z.a
Server:        192.168.4.41
Address:    192.168.4.41#53

Name:    www.z.a
Address: 192.168.4.31
 

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 【时时三省】unity test 测试框架 下载
  • 【日常记录】【JS】对一个数组,按照某个字段的值,进行分组
  • Flutter 使用 url_launcher的canLaunchUrl() 方法总是返回false错误
  • 如何用JavaScript实现视频观看时间追踪
  • lua 游戏架构 之 游戏 AI (六)ai_auto_skill
  • PCB工艺边设计准则
  • WebRTC与orange pi实现视频画面实时传输
  • arinc664总线协议
  • HarmonyOS Next 省市区级联(三级联动)筛选框
  • Golang AES 对称加密
  • Flutter开发Dart 中的 mixin、extends 和 implements
  • Linux--网络基础
  • 设计模式 之 —— 单例模式
  • 数据库系列
  • ZLMRTCClient配置说明与用法(含示例)
  • 【108天】Java——《Head First Java》笔记(第1-4章)
  • 【技术性】Search知识
  • Java读取Properties文件的六种方法
  • JS题目及答案整理
  • mysql 数据库四种事务隔离级别
  • Transformer-XL: Unleashing the Potential of Attention Models
  • 猴子数据域名防封接口降低小说被封的风险
  • 基于 Babel 的 npm 包最小化设置
  • 开发基于以太坊智能合约的DApp
  • 前端攻城师
  • 区块链分支循环
  • 使用 @font-face
  • 线上 python http server profile 实践
  • 想晋级高级工程师只知道表面是不够的!Git内部原理介绍
  • Java总结 - String - 这篇请使劲喷我
  • 教程:使用iPhone相机和openCV来完成3D重建(第一部分) ...
  • # Apache SeaTunnel 究竟是什么?
  • (附源码)springboot家庭装修管理系统 毕业设计 613205
  • (企业 / 公司项目)前端使用pingyin-pro将汉字转成拼音
  • (顺序)容器的好伴侣 --- 容器适配器
  • (贪心) LeetCode 45. 跳跃游戏 II
  • (一)python发送HTTP 请求的两种方式(get和post )
  • (转)shell调试方法
  • (转载)从 Java 代码到 Java 堆
  • ./configure、make、make install 命令
  • .Net Framework 4.x 程序到底运行在哪个 CLR 版本之上
  • .NET NPOI导出Excel详解
  • .net 验证控件和javaScript的冲突问题
  • .netcore如何运行环境安装到Linux服务器
  • .NET连接数据库方式
  • .Net通用分页类(存储过程分页版,可以选择页码的显示样式,且有中英选择)
  • .pyc文件是什么?
  • [.NET 即时通信SignalR] 认识SignalR (一)
  • [AI Google] 使用 Gemini 取得更多成就:试用 1.5 Pro 和更多智能功能
  • [AMQP Connection 127.0.0.1:5672] An unexpected connection driver error occured
  • [BZOJ 4034][HAOI2015]T2 [树链剖分]
  • [C#]winform使用引导APSF和梯度自适应卷积增强夜间雾图像的可见性算法实现夜间雾霾图像的可见度增强
  • [C++]C++基础知识概述
  • [C++提高编程](三):STL初识
  • [CentOs7]iptables防火墙安装与设置