CENTOS6.0 下安装DNS服务

yum -y install bind bind-chroot bind-devel bind-libs bind-utils

#检查安装包

rpm -qa | grep bind


cp -p /etc/named.* /var/named/chroot/etc/

cd /var/named/chroot/etc/

vi named.conf


listen-on port 53 { any; }; //改为any

allow-query     { any; }; //改为any


vi named.rfc1912.zones #编辑正向解析

追加:

zone "xx.com" IN {

       type master;

       file "xx";

       allow-update { none; };

};


cd /var/named/chroot/var/named/

cp -rf /var/named/* ./

cp -p named.empty xx

vi xx

追加

www             IN A            192.168.4.101


chown root.named * -R   //必须把文件组设置为named组

#启动服务前:

rndc-confgen -r /dev/urandom -a


#防火墙开放tcp、udp53,tcp953端口

vi /etc/sysconfig/iptables

service iptables restart


#启动服务

service named start


编辑/etc/resolv.conf文件指定dns服务器地址

nameserver 192.168.1.x


#本机测试

nslookup ping


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