Linux builds DNS master-slave synchronization

Source: Internet
Author: User
Tags dnssec

1 Build the DNS master-slave server.

1.1 Environmental Requirements:

Centos 6.5 x86_64

1.2 Hardware configuration:

Name

IP planning

Cpu

Memory

Hard disk

Primary server

192.168.0.24

4 cores

8G

80G

From the server

192.168.0.34

4 cores

8G

80G

1.3 Package Installation:

[email protected] ~]# Yum install-y bind Bind-chroot Bind-utlis

1.4 Configuration files:

/etc/named.conf bind service master configuration file.

/var/named/zone file.

1.5 Copy profile Template:

[Email protected] ~]# cp-rv/usr/share/doc/bind-9.8.2/sample/etc/*/var/named/chroot/etc/

[Email protected] ~]# cp-rv/usr/share/doc/bind-9.8.2/sample/var/*

1.6 To modify the master configuration file:

[Email protected] ~]# vi/var/named/chroot/etc/named.conf

Options

{

    // Put files that named is allowed to write in the data/ directory:    directory               "/var/named";           // "Working" directory    dump-file               "data/cache_dump.db";    statistics-file         "data/named_stats.txt";    memstatistics-file      "data/named_mem_stats.txt";    //listen-on port 53     { any; };    listen-on port 53       { any; };    //listen-on-v6 port 53  { any; };    listen-on-v6 port 53    { ::1; };    allow-query             { any; };    allow-query-cache       { any; };    forwarders             { 10.0.0.1;114.114.114.114; };    recursion yes;    dnssec-enable yes;    dnssec-validation yes;

};

Zone "zabbix.73go.cn" {

  type  master;  file "zabbix.73go.cn.zone";

};

1.7 Modifying Zone files:

[Email protected] named]# cd/var/named/chroot/var/named

[email protected] named]# cat Zabbix.73go.cn.zone

$TTL 1D

@ in SOA @ rname.invalid. (

                                    0       ; serial                                    1D      ; refresh                                    1H      ; retry                                    1W      ; expire                                    3H )    ; minimum    NS      @    A       127.0.0.1    AAAA    ::1    IN    A  192.168.0.236

1.8 Syntax Check:

[Email protected] named]# named-checkconf/var/named/chroot/etc/named.conf

[Email protected] named]# Named-checkzone linuxcast.net linuxcast.net.zone

1.9 Restart Service:

[Email protected] named]# service named Reload

Or

[Email protected] named]# service named restart

2 Configuration from server:

2.1 Package Installation:

[email protected] ~]# Yum install-y bind Bind-chroot Bind-utlis

2.2 Copy profile Template:

[Email protected] ~]# cp-rv/usr/share/doc/bind-9.8.2/sample/etc/*/var/named/chroot/etc/

2.3 Changing the server from the configuration file

[Email protected] etc]# vi/var/named/chroot/etc/named.conf

Options

{

    // Put files that named is allowed to write in the data/ directory:    directory               "/var/named";           // "Working" directory    dump-file               "data/cache_dump.db";    statistics-file         "data/named_stats.txt";    memstatistics-file      "data/named_mem_stats.txt";    //listen-on port 53     { any; };    listen-on port 53       { any; };    //listen-on-v6 port 53  { any; };    listen-on-v6 port 53    { ::1; };    allow-query             { any; };    allow-query-cache       { any; };    forwarders             { 10.0.0.1;114.114.114.114; };    recursion yes;    dnssec-enable yes;    dnssec-validation yes;

};

Zone "zabbix.73go.cn" {

  type  slave; masters{ 192.168.0.24; };  file "slaves/zabbix.73go.cn.zone";

};

2.4 Restart Service:

[Email protected] named]# service named Reload

Or

[Email protected] named]# service named restart

2.5 Guaranteed Directory Permissions:

[email protected] named]# LL

Drwxrwxrwx. 2 named named 4096 July 5 17:55 Slaves

2.6 View the Sync zone file.

[Email protected] slaves]# cat/var/named/chroot/var/named/slaves

2.7 Verification:

C:\users\admin>nslookup zabbix.73go.cn

Server: UnKnown

address:192.168.0.24

Name: zabbix.73go.cn

Addresses::: 1

      127.0.0.1      192.168.0.236

Linux builds DNS master-slave synchronization

Related Article

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.