Building a master-slave DNS server

Source: Internet
Author: User

I. DNS Master-Slave understanding

Master-Slave server, in the beginning of the understanding, that is the primary DNS server hangs, (the DNS service automatically turned to the secondary DNS server), the client can continue to parse. It doesn't seem like that. When I shut down the primary DNS, the client only has a DNS server, and it turns out that parsing is a failure. But when I switch the client's DNS server to the IP from DNS, the parsing is normal. Note that the file from the server only synchronizes the primary server resolution domain.

The environment of this case:

System: Centos6.5

IP: Primary DNS 192.168.40.105 from DNS 192.168.40.170

Iptables: Off state.

Two. Configuration of the primary DNS server

The primary DNS server is described in the previous article in the blog. Please click here: Build the primary DNS server.

This is only the modified part of the primary DNS server configuration file:

1vim/var/named/chroot/etc/Named.rfc1912.zones2~~~3 4Zone"test.com"In {5     type master;6     file "named.test.com";7allow-update {none;};8Allow-transfer {192.168.40.170;};9     notify yes;Ten }; One  AZone"40.168.192.in-addr.arpa"In { -     type master; -     file "named.192.168.40"; theallow-update {none;}; -Allow-transfer {192.168.40.170;}; - notify yes; -};

In addition, in the previous article, there are some optimizations and issues that need to be done to the DNS server, as shown in the following:

1 vim/var/named/chroot/etc/named.conf  2 ~ ~ 3Options {  4  5     allow-query     {any;}; 6     recursion yes; 7     114.114. 114.114      ; }; (Here, do is DNS forwarding, when the local server can not be resolved, such as the domain name on the public network, forwarded to 114.114.114.114) 8 }; 9 Ten ~ ~ ~

After the modification is complete, restart the primary DNS daemon named.

Three. Configuration from the DNS server

1. Change the Yum source first, then install the dev Kit and finally install the BIND software.

1 wget -o/etc/Yumrepos.d/centos-base.repo http://mirrors.aliyun.com/repo/ Centos-6.repo23yum"development tools"4 5 Yum Install bind*

2. After modifying the main configuration file of Bind,/var/named/chroot/etc/named.rfc1912.zones

1vim/var/named/chroot/etc/Named.rfc1912.zones2 3Zonethe test. com"In {4     type slave; #设置dns类型为从服务器5     file "slaves/named.test.com"; # ' from server ' synchronize the location of the domain name file from the primary DNS server/var/named/chroot/var/named/slaves/6Masters {192.168.40.105; }; #设置主dns服务器的地址7allow-update {none;};8 };9 TenZone"40.168.192.in-addr.arpa"In { One     type slave; A     file "slaves/named.192.168.40"; -Masters {192.168.40.105; }; -allow-update {none;}; the};

3. Simple modification Here, the client is not able to parse. Because there is another important place to configure. (There has been a mistake here, when the main stop, the client has been unable to parse until after it has been changed.) )

1 vim vim/var/named/chroot/etc/named.conf, modify the following options 23options{ 4 5  - 192.168. 40.170      ; }; #这里要写从服务器的ip地址.  6 allow-query {any;}; 7 8 };

4. Restart the named service. It is also critical to remember to close the iptables during the test, or append the DNS service port to the firewall rule.

Four. Summary test

1. You can now turn off primary DNS, and then the client modifies DNS to the IP from the DNS server to check that the domain name resolution is normal.

2. If you encounter a DNS server startup is normal, but the resolution is not normal, please check the system log,/var/log/messages file.

Building a master-slave DNS server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.