Linux基础服务——Bind DNS服务 Part2 (2)

以上可见相应的Server为192.168.100.50服务器,将主DNS关闭后再次进行测试。

[root@localhost ~]# dig ; <<>> DiG 9.11.20-RedHat-9.11.20-5.el8 <<>> ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44650 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ; COOKIE: 527a8826a09007e405815b9560be06449ec3acd3b38c6dee (good) ;; QUESTION SECTION: ; IN A ;; ANSWER SECTION: 86400 IN A 192.168.100.20 ;; AUTHORITY SECTION: test.com. 86400 IN NS dns.test.com. test.com. 86400 IN NS dns2.test.com. ;; ADDITIONAL SECTION: dns.test.com. 86400 IN A 192.168.100.50 dns2.test.com. 86400 IN A 192.168.100.60 ;; Query time: 0 msec ;; SERVER: 192.168.100.60#53(192.168.100.60) ;; WHEN: Mon Jun 07 15:43:00 EDT 2021 ;; MSG SIZE rcvd: 154

可见Server转变成为了192.168.100.60,它们同时提供了服务。

区域文件的更新

当在区域文件内添加内容时,需要更新SOA记录中的Serial(序列号),对于区域传送来说,它通过Serial的大小来区分区域文件的新旧,Serial值越大则区域文件越新。例如我需要在100.168.192.in-addr.arpa区域文件中添加一条A记录,那么我就需要将Serial加一,如下。

Linux基础服务——Bind DNS服务 Part2

Serial由0变为1,然后查看系统日志观察区域传送的更新(从服务器端日志)

Jun 07 08:02:00 localhost.localdomain named[1570]: client @0x7f12e80bf9f0 192.168.100.50#37234: received notify for zone '100.168.192.in-addr.arpa' Jun 07 08:02:00 localhost.localdomain named[1570]: zone 100.168.192.in-addr.arpa/IN: notify from 192.168.100.50#37234: zone is up to date Jun 07 08:03:21 localhost.localdomain named[1570]: client @0x7f12e80bf9f0 192.168.100.50#35630: received notify for zone 'test.com' Jun 07 08:03:21 localhost.localdomain named[1570]: zone test.com/IN: notify from 192.168.100.50#35630: zone is up to date Jun 07 08:03:21 localhost.localdomain named[1570]: client @0x7f12e80bf9f0 192.168.100.50#58424: received notify for zone '100.168.192.in-addr.arpa' Jun 07 08:03:21 localhost.localdomain named[1570]: zone 100.168.192.in-addr.arpa/IN: notify from 192.168.100.50#58424: serial 1 Jun 07 08:03:21 localhost.localdomain named[1570]: zone 100.168.192.in-addr.arpa/IN: Transfer started. Jun 07 08:03:21 localhost.localdomain named[1570]: transfer of '100.168.192.in-addr.arpa/IN' from 192.168.100.50#53: connected using 192.168.100.60#49353 Jun 07 08:03:21 localhost.localdomain named[1570]: zone 100.168.192.in-addr.arpa/IN: transferred serial 1 Jun 07 08:03:21 localhost.localdomain named[1570]: transfer of '100.168.192.in-addr.arpa/IN' from 192.168.100.50#53: Transfer status: success Jun 07 08:03:21 localhost.localdomain named[1570]: transfer of '100.168.192.in-addr.arpa/IN' from 192.168.100.50#53: Transfer completed: 1 messages, 9 records, 262 bytes, > Jun 07 08:03:21 localhost.localdomain named[1570]: zone 100.168.192.in-addr.arpa/IN: sending notifies (serial 1)

可以看到,主服务器发出了通知告诉从服务器,区域文件需要被升级,那么从服务器将会开启区域传送传送新的区域文件到本机,在日志中Serial将会被记录。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwwfsp.html