centos7 dns安装记录

yum install -y bind bind-chroot bind-util bind-libs

vi /etc/named.conf

listen-on port 53 { 192.168.100.10; };

allow-query     { any; };

zone "sleeper.com" IN {

type master;

file "zone.sleeper.com";

};

zone "100.168.192.in-addr.arpa" IN {

type master;

file "zone.192.168.100";

};

cd /var/named(注:在/etc/named.conf中有directory "/var/named";项,区域文件内容位置要和这里相符,不然启动named服务会报错

正向解析区域

vi zone.sleeper.com

$TTL 86400

@INSOAdc002.sleeper.com. zwj.sleeper.com.(

001

1D

1H

1W

3H)

INNSdc002.sleeper.com.

dc002INA192.168.100.20

dc001INA192.168.100.10

反向解析区域

vi zone.192.168.100

$TTL 86400

@INSOAdc002.sleeper.com. zwj.sleeper.com.(

001

1D

1H

1W

3H)

INNSdc002.sleeper.com.

20INPTRdc002.sleeper.com.

10INPTRdc001.sleeper.com.


修改NDS服务器地址:

vi /etc/resolv.conf

nameserver 192.168.100.20


测试

[root@dc002 named]# nslookup dc001.sleeper.com

Server:192.168.100.20

Address:192.168.100.20#53


Name:dc001.sleeper.com

Address: 192.168.100.10


你可能感兴趣的:(dns,CentOS7)