Parsing the configuration of the main pros and cons from the DNS server

The primary server (Centos 7 192.168.100.175)

1, constructed warehouse yum, yum mounting bind with

 

2, turn off the firewall

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

 

 3, to add the IP address of the machine

[root@localhost ~]# vim /etc/resolv.conf

nameserver 192.168.100.175
nameserver 192.168.100.170

 

4, modify the hosts file, add the domain name with the IP address

[root@localhost ~]# vim /etc/hosts

192.168.100.175 ns1.crushlinux.com
192.168.100.170 ns2.crushlinux.com

 

5, modify the configuration file /etc/named.conf

[root@localhost ~]# vim /etc/named.conf

 

options {
        directory       "/var/named";
};
zone "crushlinux.com" IN {
        type master;
        file "crushlinux.zheng";
        allow-transfer {192.168.100.170;};
};
zone "100.168.192.in-addr.arpa" IN {
        type master;
        file "crushlinux.fan";
        allow-transfer {192.168.100.170;};
};

 

6, in the / var / named / created crushlinux.zheng

[root@localhost ~]# vim /var/named/crushlinux.zheng

$TTL 86400
@       IN      SOA     crushlinux.com.   admin.crushlinux.com. (
                    20190817
                    3H
                    15M
                    1W
                    1D
)
           IN      NS      ns1.crushlinux.com.
           IN      NS      ns2.crushlinux.com.
           IN      MX 10   mail.crushlinux.com.
ns1     IN      A       192.168.100.175
ns2     IN      A       192.168.100.170
mail    IN      A       192.168.100.171
www   IN      A       192.168.100.172
study  IN      A       192.168.100.173
*          IN      A       192.168.100.175
ftp       IN      CNAME   www

 

7, in / var / named / create and edit crushlinux.fan

[root@localhost ~]# vim /var/named/crushlinux.fan

$ TTL 86400
@ IN SOA crushlinux.com. admin.crushlinux.com. (
                    20,190,817
                    3H
                    15M
                    1W
                    1D
)
           IN NS ns1.crushlinux.com.
           IN NS ns2.crushlinux.com.
           IN MX 10 mail.crushlinux.com.
175 IN PTR ns1.crushlinux.com.
170 IN PTR ns2.crushlinux.com.
171 IN PTR mail.crushlinux.com.
172 IN PTR www.crushlinux.com.
173 IN PTR study.crushlinux.com.
175 IN PTR ns1.crushlinux.com.

 

8, change file permissions

[root@localhost ~]# chown :named /var/named/crushlinux.*

 

9, see the main configuration file is correct

[root@localhost ~]# named-checkconf -z /etc/named.conf
zone crushlinux.com/IN: loaded serial 20190817
zone 100.168.192.in-addr.arpa/IN: loaded serial 20190817

 

10, see the pros and cons of the zone data file is correct

[root@localhost ~]# named-checkzone crushlinux.com /var/named/crushlinux.zheng

[root@localhost ~]# named-checkzone crushlinux.com /var/named/crushlinux.fan

 

11, restart the service, check the service status

[root@localhost ~]# systemctl restart named

[root@localhost ~]# systemctl status named

 

From the server (Centos 6 192.168.100.170)

1, create a directory, mount the mirror

[root@localhost ~]# mkdir /media/cdrom

[root@localhost ~]# mount /dev/cdrom /media/cdrom

 

2, install bind service

[root@localhost ~]# rpm -ivh /media/cdrom/Packages/bind-9.8.2-0.17.rc1.el6_4.6.x86_64.rpm

 

3, from the primary server to copy files from the server

[root@localhost ~]# scp /etc/named.conf 192.168.100.170:/etc/

 

 

3、

[root@localhost ~]# service iptables stop

[root@localhost ~]# service iptables status

 

4, modify the configuration file

[root@localhost ~]# cat /etc/resolv.conf

 

 

nameserver 192.168.100.175
nameserver 192.168.100.170

[root@localhost ~]# vim /etc/hosts

192.168.100.175 ns1.crushlinux.com
192.168.100.170 ns2.crushlinux.com

[root@localhost ~]# vim /etc/named.conf

options {
        directory       "/var/named";
};
zone "crushlinux.com" IN {
        type slave;
        file "slaves/crushlinux.zheng";
        masters { 192.168.100.175; };
};
zone "100.168.192.in-addr.arpa" IN {
        type slave;
        file "slaves/crushlinux.fan";
        masters { 192.168.100.175; };
};
 
4. Restart
[root@localhost ~]# service named restart
 

 

Guess you like

Origin www.cnblogs.com/tanxiaojuncom/p/11369141.html