首页 > 代码库 > centos7 dns安装记录

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

@ IN SOA dc002.sleeper.com. zwj9152.arcsoft.com.cn.(

001

1D

1H

1W

3H)

IN NS dc002.sleeper.com.

dc002 IN A 192.168.100.20

dc001 IN A 192.168.100.10

反向解析区域

vi zone.192.168.100

$TTL 86400

@ IN SOA dc002.sleeper.com. zwj9152.arcsoft.com.cn.(

001

1D

1H

1W

3H)

IN NS dc002.sleeper.com.

20 IN PTR dc002.sleeper.com.

10 IN PTR dc001.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


centos7 dns安装记录