In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Prepare
Example: two sets of 192.168.11.10 (master), 192.168.11.11 (slave), domain name www.test1.com
# all master and slave DNS servers need to install bind, bind-chroot and bind-utilsyum-y install bind bind-utils bind-chroot#. If the firewall is enabled, configure the firewall and add services (ignored if the firewall is disabled) firewall-cmd-- permanent-- add-service=dnsfirewall-cmd-- reload
2. Main DNS server (192.168.11.10) configuration
# Edit the configuration file vim / etc/named.conf# to find two lines listen-on port 53 {127.0.0.1;}; allow-query {localhost;}; # modify to listen-on port 53 {any;}; allow-query {any;}
3. Configure forward parsing
# Edit the file / etc/named.rfc1912.zones, and add the domain zone "test1.com" IN {type master; file "data/test1.com.zone" at the end;}; # create the test1.com.zone parsing field vim / var/named/data/test1.com.zone $TTL 3H @ IN SOA test1.com. Root (20180928; serial 1D; refresh 1H; retry 1W) Expire 3H); minimum IN NS @ IN A 192.168.11.10 www IN A 192.168.11.10 ftp IN A 192.168.11.1 editing / etc/resolv.conf, adding search localdomain nameserver 192.168.11.10
4. Restart the DNS server
# restart namedsystemctl restart named# to view status systemctl status named
5. Check whether the parsing is successful
The # ping command verifies that the ping-c 4 www.test1.com# output is parsed successfully as follows: PING www.test1.com (192.168.11.10) 56 (84) bytes of data .64 bytes from ftp.test1.com (192.168.11.10): icmp_seq=1 ttl=64 time=0.033 ms 64 bytes from ftp.test1.com (192.168.11.10): icmp_seq=2 ttl=64 time=0.058 ms 64 bytes from ftp.test1.com (192. 168.11.10): icmp_seq=3 ttl=64 time=0.066 ms 64 bytes from ftp.test1.com (192.168.11.10): icmp_seq=4 ttl=64 time=0.057 ms-www.test1.com ping statistics-4 packets transmitted 4 received, 0% packet loss, time 3000ms rtt min/avg/max/mdev = 0.033 packet loss 0.066 Universe 0.014 ms# nslookup command verify nslookup > www.test1.com# output is as follows: Server: 192.168.11.10 Address: 192.168.11.10 Name 53: www.test1.com Address: 192.168.11.10
6. Configure reverse resolution
# Edit the file / etc/named.rfc1912.zones and add vim etc/named.rfc1912.zones zone "11.168.192.in-addr.arpa" IN {type master; file "data/11.168.192.zone" at the end;}; # create the 11.168.192.zone resolution domain vim / var/named/data/11.168.192.zone $TTL 3H @ IN SOA web3.com. Root (20180928; serial 1D; refresh 1H; retry 1W; expire 3H) Minimum @ IN NS www.test1.com. 10 IN PTR www.test1.com. 10 IN PTR ftp.test1.com.
7. Restart the DNS server
# restart namedsystemctl restart named# to view status systemctl status named
8. Check whether the parsing is successful
# ping command verifies that the output of ping-c 4 192.168.11.1 is as follows: PING 192.168.11.10 (192.168.11.10) 56 (84) bytes of data .64 bytes from 192.168.11.10: icmp_seq=1 ttl=64 time=0.061 ms 64 bytes from 192.168.11.10: icmp_seq=2 ttl=64 time=0.058 ms 64 bytes from 192.168.11.10: icmp_seq=3 ttl=64 time=0.081 ms 64 bytes from 192.168.11.10: icmp_seq=4 ttl=64 time=0.060 ms-192.168.11.10 ping statistics-4 packets transmitted 4 received, 0 packet loss The ms# nslookup command verifies that the output of nslookup 192.168.11.1 is Server: 192.168.11.10 Address: 192.168.11.10 Address: 192.168.11.10 account 53 10.11.168.192.in-addr.arpa name = ftp.test1.com. 10.11.168.192.in-addr.arpa name = www.test1.com.
9. Configure the slave DNS server (192.168.11.11)
# modify the configuration of the main DNS server (192.168.11.10) / etc/named.rfc1912.zonesvim / etc/named.rfc1912.zones zone "test1.com" IN {type master; file "data/test1.com.zone"; allow-transfer {192.168.11.11;}; notify yes; also-notify {192.168.11.11;}; zone "11.168.192.in-addr.arpa" IN {type master File "data/11.168.192.zone"; allow-transfer {192.168.11.11;}; notify yes; also-notify {192.168.11.11;}
10. Configuration forward parsing from DNS server (192.168.11.11)
# Edit the named.conf file vim / etc/named.conf # to find two lines listen-on port 53 {127.0.0.1;}; allow-query {localhost;}; # modify to listen-on port 53 {any;}; allow-query {any;} # Edit the file / etc/named.rfc1912.zones, and add the domain vim / etc/named.rfc1912.zones zone "test1.com" IN {type slave; file "data/test1.com.zone";}; masters {192.168.11.10;} at the end # create test1.com.zonek empty file touch / var/named/data/test1.com.zone # set owner chown named:named test1.com.zone# edit / etc/resolv.conf, add vim / etc/resolv.conf search localdomain nameserver 192.168.11.11
Restart the DNS server
# restart namedsystemctl restart named# to view status systemctl status named
12. Check whether the parsing is successful
The # ping command verifies that the ping-c 4 www.test1.com# output is parsed successfully as follows: PING www.test1.com (192.168.11.10) 56 (84) bytes of data .64 bytes from ftp.test1.com (192.168.11.10): icmp_seq=1 ttl=64 time=0.033 ms 64 bytes from ftp.test1.com (192.168.11.10): icmp_seq=2 ttl=64 time=0.058 ms 64 bytes from ftp.test1.com (192. 168.11.10): icmp_seq=3 ttl=64 time=0.066 ms 64 bytes from ftp.test1.com (192.168.11.10): icmp_seq=4 ttl=64 time=0.057 ms-www.test1.com ping statistics-4 packets transmitted 4 received, 0% packet loss, time 3000ms rtt min/avg/max/mdev = 0.033 packet loss 0.066 Universe 0.014 ms# nslookup command verify nslookup > www.test1.com# output is as follows: Server: 192.168.11.11 Address: 192.168.11.11 Universe 53 Name: www.test1.com Address: 192.168.11.10
13. Configure reverse parsing from DNS server (192.168.11.11)
# add vim etc/named.rfc1912.zones zone "11.168.192.in-addr.arpa" IN {type master; file "data/11.168.192.zone" to the file / etc/named.rfc1912.zones; masters {192.168.11.10;};}; # create an empty file 11.168.192.zonetouch / var/named/data/11.168.192.zone# setting owner chown named:named 11.168.192.zone
14. Restart DNS server
# restart namedsystemctl restart named# to view status systemctl status named
15. Check whether the files / var/named/data/test1.com.zone and / var/named/data/11.168.192.zone have binary data
Cat / var/named/data/test1.com.zonecat / var/named/data/11.168.192.zone
16. Check whether the parsing is successful
# ping command verifies that the output of ping-c 4 192.168.11.1' is parsed as follows: PING 192.168.11.11 (192.168.11.11) 56 (84) bytes of data .64 bytes from 192.168.11.11: icmp_seq=1 ttl=64 time=0.061 ms 64 bytes from 192.168.11.11: icmp_seq=2 ttl=64 time=0.058 ms 64 bytes from 192.168.11.11: icmp_seq=3 ttl=64 time=0.081 ms 64 bytes from 192.168.11.11: icmp_seq=4 ttl=64 time=0.060 ms-192.168.11.11 ping statistics-4 packets transmitted 4 received, 0 packet loss Time 3000ms rtt min/avg/max/mdev = 0.058 ms# nslookup 0.065 10.11.168.192.in-addr.arpa name 0.009 ms# nslookup command verify nslookup 192.168.11.1 output is as follows: 192.168.11.11 Address: 192.168.11.11 account 53 10.11.168.192.in-addr.arpa name = ftp.test1.com. 10.11.168.192.in-addr.arpa name = www.test1.com.
Summary
The above is the tutorial of building Centos7 master-slave DNS server introduced by Xiaobian to you. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.