Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The Construction method of DNS Master-Slave synchronization

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "the building method of DNS master-slave synchronization". In the daily operation, I believe that many people have doubts about the building method of DNS master-slave synchronization. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "DNS master-slave synchronization". Next, please follow the editor to study!

The basic introduction of DNS will not go into detail here. Let's start with the network configuration and introduce how to build DNS master-slave synchronization.

There are four reasons why the master-slave server triggers the synchronization process:

1. From the domain name server that has just started

two。 The Serial value of the primary domain name server increases

3. The rndc reload command was executed

4. It's time to synchronize the update of the master-slave server.

Network test choice: we choose VMnet4 network and use setup to set the server IP address. Here, we take the 192.168.0.70 address as an example to build a DNS server.

The IP address of the primary server is 192.168.0.70

The IP address of the slave server is 192.168.0.80

Install bind, yum install bind on both master and slave servers

Configure the primary server

There are two profiles:

/ etc/named.cof

[html] view plain copy

Options {

Listen-on port 53 {any;}; # define listening port and IP

Listen-on-v6 port 53 {:: 1;}; # defines the address of the listening IPV6

Directory "/ var/named"; # Global Catalog

Dump-file "/ var/named/data/cache_dump.db"

Statistics-file "/ var/named/data/named_stats.txt"

Memstatistics-file "/ var/named/data/named_mem_stats.txt"

Allow-query {any;}; # IP addresses allowed to be queried

Recursion yes; # allows recursive queries

Dnssec-enable yes

Dnssec-validation yes

Dnssec-lookaside auto

Add zone at the end of this configuration file

[html] view plain copy

Zone "wg.com" IN {

Type master; # defines the type of primary server

File "wg.com.zone"; # defines the region data file path, which is located in the / var/named/ directory by default

Allow-transfer {192.168.0.80;}

Configure the zone file, named wg.con.zone

[html] view plain copy

$TTL 600

@ IN SOA dns.wg.com. Dsnadmin.wg.com. (2017120302 2H 4M 1D 2D)

@ IN NS dns.wg.com.

@ IN NS ns2.wg.com.

@ IN MX 10 mail.wg.com.

Dns IN A 192.168.0.70

Mail IN A 192.168.0.12

Www IN A 192.168.0.48

Ns2 IN A 192.168.0.80

The first record of the resource record for each region must be SOA, followed by the domain name and email address of the DNS server SOA.

Note:

[html] view plain copy

@ IN SOA dns.wubinary.com dnsadmin.wubinary.com (

201712032; identify serial number, decimal number, no more than 10 digits, usually used date

2H; refresh time, that is, how often do you check at the main server, here it is 2 hours

4m; retry time, which should be less than refresh time, in this case, 4 minutes

1D; expiration time, 1 day here

2D; the maximum time to work from the server after the primary server is hung up, here is 2 days)

After the main server is set up, remember to turn off the firewall and selinux

Start the service service named restart

From the server's configuration file: / etc/named.conf

The upper part of the configuration file is the same as the main server

[html] view plain copy

Options {

Listen-on port 53 {any;}

Listen-on-v6 port 53 {:: 1;}

Directory "/ var/named"

Dump-file "/ var/named/data/cache_dump.db"

Statistics-file "/ var/named/data/named_stats.txt"

Memstatistics-file "/ var/named/data/named_mem_stats.txt"

Allow-query {any;}

Recursion yes

Dnssec-enable yes

Dnssec-validation yes

Dnssec-lookaside auto

[html] view plain copy

Zone "wg.com" IN {

Type slave

Masters {192.168.0.70;}

File "slaves/wg.com.zone"; / / synchronized files will be placed in this location

Allow-transfer {none;}

Restart the service service named restart

At this point, you can see that there are synchronized zone files under the path of slaves.

[root@wg64 slaves] # ls

Wg.com.zone

[root@wg64 slaves] # pwd

/ var/named/slaves

A simple master-slave synchronization test environment is built.

If you want to test, you can add a record in the master server to test whether the slave server is synchronously added.

At this point, the study on the "building method of master-slave synchronization of DNS" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report