1. Preparation Example: Two machines: 192.168.219.146 (master), 192.168.219.147 (slave), domain name www.panyangduola.com Both the master and slave DNS servers need to install bind, bind-chroot, and bind-utils If the firewall is enabled, configure the firewall and add services (ignore if the firewall is disabled) firewall-cmd --permanent --add-service=dns firewall-cmd --reload 2. Primary DNS server (192.168.219.146) configuration Editing the Configuration File Find two of the lines listen-on port 53 { 127.0.0.1; }; allow-query { localhost; }; Modified to listen-on port 53 { any; }; allow-query { any; }; 2-1. Configure forward parsing Edit the file /etc/named.rfc1912.zones and add the domain to be resolved at the end vim /etc/named.rfc1912.zones zone "panyangduola.com" IN { type master; file "data/panyangduola.com.zone"; }; Create panyangduola.com.zone resolution domain vim /var/named/data/panyangduola.com.zone $TTL 3600 $ORIGIN panyangduola.com. @ IN SOA panyangduola.com. admin.panyangduola.com. ( 2018042101 1D 1H 1W 3H ) @ IN NS ns1.panyangduola.com. @ IN NS ns2.panyangduola.com. ns1 IN A 192.168.219.146 ns2 IN A 192.168.219.147 www IN A 192.168.219.146 web IN CNAME www 2-2. Configure reverse resolution Edit the file /etc/named.rfc1912.zones and add the domain to be resolved at the end vim /etc/named.rfc1912.zones zone "219.168.192.in-addr.arpa" IN { type master; file "data/219.168.192.zone"; }; Create 219.168.192.zone resolution domain vim /var/named/data/219.168.192.zone $TTL 3600 $ORIGIN 219.168.192.in-addr.arpa. @ IN SOA panyangduola.com. admin.panyangduola.com. ( 2018042101 1D 1H 1W 3H ) @ IN NS ns1.panyangduola.com. @ IN NS ns2.panyangduola.com. 146 IN PTR ns1.panyangduola.com. 147 IN PTR ns2.panyangduola.com. 146 IN PTR www.panyangduola.com. 2-3. Perform a syntax check on the DNS configuration file: cd /etc named-checkconf named.conf named-checkconf named.rfc1912.zones cd /var/named/data named-checkzone panyangduola.com panyangduola.com.zone named-checkzone 219.168.192.in-addr.arpa 219.168.192.zone 2-4. Edit /etc/resolv.conf and add vim /etc/resolv.conf search localdomain nameserver 192.168.219.146 2-5. If no error occurs in step 2-3, start the named service Restart named View Status 2-6. Check whether the primary DNS server resolution is successful Ping command verification ping -c 4 www.panyangduola.com nslookup command verification nslookup >www.panyangduola.com nslookup >192.168.219.146 3. Configure from DNS server (192.168.219.147) Edit named.conf File Find two of the lines listen-on port 53 { 127.0.0.1; }; allow-query { localhost; }; Modified to listen-on port 53 { any; }; allow-query { any; }; 3-1. Modify the configuration of the primary DNS server (192.168.219.146) /etc/named.rfc1912.zones vim /etc/named.rfc1912.zones zone "panyangduola.com" IN { type master; file "data/panyangduola.com.zone"; allow-transfer {192.168.219.147;}; notify yes; also-notify {192.168.219.147;}; }; zone "219.168.192.in-addr.arpa" IN { type master; file "data/219.168.192.zone"; allow-transfer {192.168.219.147;}; notify yes; also-notify {192.168.219.147;}; }; 3-2. Configure forward resolution from the DNS server (192.168.219.147) Edit the file /etc/named.rfc1912.zones and add the domain to be resolved at the end vim /etc/named.rfc1912.zones zone "panyangduola.com" IN { type slave; file "data/panyangduola.com.zone"; masters { 192.168.219.146; }; }; Create an empty file for panyangduola.com.zone Set Owner cd /var/named/data chown named:named panyangduola.com.zone 3-3. Configure reverse resolution from the DNS server (192.168.219.147) Add in the file /etc/named.rfc1912.zones vim etc/named.rfc1912.zones zone "219.168.192.in-addr.arpa" IN { type slave; file "data/219.168.192.zone"; masters { 192.168.219.146; }; }; Create an empty file 219.168.192.zone Set Owner cd /var/named/data chown named:named 219.168.192.zone 3-4. Perform a syntax check on the DNS configuration file: cd /etc named-checkconf named.conf named-checkconf named.rfc1912.zones 3-5. Edit /etc/resolv.conf and add vim /etc/resolv.conf search localdomain nameserver 192.168.219.147 3-6. If no error occurs in step 3-4, start the named service Restart named View Status 3-7. Check whether the files /var/named/data/panyangduola.com.zone and /var/named/data/219.168.192.zone contain binary data cat /var/named/data/panyangduola.com.zone cat /var/named/data/219.168.192.zone 3-8. Check whether the resolution from the DNS server is successful Ping command verification ping -c 4 www.panyangduola.com nslookup command verification nslookup >192.168.219.147 Summarize The above is what I introduced to you about the deployment of master and slave DNS servers in centos7.x. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed explanation of Strict mode in JavaScript
>>: MySQL max_allowed_packet setting
1. Press win + R and type cmd to enter the DOS wi...
Table of contents introduction Distinguish betwee...
Table of contents 1. What is a design pattern? 2....
ant-design-vue customizes the use of Ali iconfont...
Table of contents 1. jsonp cross-domain 2. docume...
Table of contents Canal Maxwell Databus Alibaba C...
This article shares the specific code of JavaScri...
Preface: I heard a long time ago that MySQL 8.0 s...
1. What is a two-column layout? There are two typ...
1. Official website address The official website ...
Antd+react+webpack is often the standard combinat...
Tutorial Series MySQL series: Basic concepts of M...
Preface As we all know, JavaScript is single-thre...
Install PostgreSQL 11 on CentOS 7 PostgreSQL: The...
1. Javascript returns to the previous page history...