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 ntpdate2488: 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

相关推荐
tg_xianheyun6 小时前
CDN节点分布如何影响网页加载速度和用户体验
服务器·cdn加速·全球访问优化
lsh曙光6 小时前
延时at指令和定时cron指令
linux·服务器·网络
圆山猫6 小时前
[Virtualization](四):Linux KVM/RISC-V 的 vCPU 运行路径
java·linux·risc-v
布鲁飞丝7 小时前
vivo Pulsar 万亿级消息处理实践()-Ansible运维部署
运维·ansible
XR1234567887 小时前
企业全光网络架构选型技术白皮书:从物理层到运维层的全链路分析
运维·网络·架构
似的8357 小时前
一步一步学习使用FireMonkey动画() 使用TAnimator类创建动画
linux·学习·nginx
HiDev_7 小时前
【非标自动化】2、认识元器件(直线模组)
运维·自动化
mingo_敏8 小时前
DeepAgents : 权限(Permissions)
人工智能·深度学习·langchain
江畔柳前堤8 小时前
信号的本质——从模拟波形到AI中的数据张量
人工智能·深度学习·机器学习·计算机视觉·数据挖掘·语音识别
夏殇之殁8 小时前
包中创建自定义列表项。 . 使用自定义列表项进行数据绑定 . 将天气预报数据保存到本地内存表,通过LiveBindings进行显示。 ...
服务器·前端·javascript