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; }; }; ![](https://i-blog.csdnimg.cn/direct/e5a6ff502943495db353a79c47b117b3.png) \[root@dns \~\]# vim /var/named/z.a.zone ![](https://i-blog.csdnimg.cn/direct/52df2850316844869574b84d07039b12.png) \[root@dns \~\]# vim /etc/named.conf![](https://i-blog.csdnimg.cn/direct/8ae62c65499c4996850cfc9f8cf2734c.png) 对文件进行检查,查看是否有错误: \[root@dns \~\]# named-checkconf /etc/named.rfc1912.zones \[root@dns \~\]# named-checkconf /etc/named.conf \[root@dns \~\]# named-checkzone /var/named/z.a.zone 回到客户机进行访问测试: ![](https://i-blog.csdnimg.cn/direct/a20bfed834f248b1a6bf57709e208fad.png) ## 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;}; ![](https://i-blog.csdnimg.cn/direct/8f1a5c34d49c489f828f8ceae0f21334.png) \[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

相关推荐
吃饭最爱6 分钟前
Elasticsearch的用法
运维·jenkins
wanhengidc12 分钟前
云手机通常使用什么架构
服务器·网络·安全·游戏·智能手机·云计算
Danceful_YJ23 分钟前
35.微调BERT
人工智能·深度学习·bert
emiya_saber23 分钟前
Linux 文件系统基本管理
linux·运维·服务器
夜月yeyue32 分钟前
Linux 内核驱动加载机制
linux·服务器·stm32·嵌入式硬件
愿没error的x36 分钟前
深度学习基础知识总结(一):深入理解卷积(Convolution)
人工智能·深度学习
好记忆不如烂笔头abc1 小时前
Oracle19c rac两节点实例test,在节点1查看监听状态没有test1,但在节点2可以看到test2
运维·服务器
牢七1 小时前
Linux新
linux
初学者_xuan1 小时前
零基础新手小白快速了解掌握服务集群与自动化运维(十八)Ansible自动化模块--安装与入门
运维·自动化·ansible
风无雨1 小时前
windows docker 配置镜像
运维·docker·容器