CentOS系统DNS安装及配置

一:安装软件
yum -y install bind bind-chroot bind-libs bind-utils caching-nameserver

二:配置

cd /var/named/chroot/etc/
cp -p named.caching-nameserver.conf named.conf

options{
directory "/var/named/";
};

zone "test.com" IN{
type master;
file "test.com.zone";
};

zone "linux.com" IN{
type master;
file "linux.com.zone";
};

zone "1.168.192.in-addr.arpa" IN {
    type master;
    file "192.168.1.zone";
    allow-update { none; };
};


cd /var/named/chroot/var/named/
cp -p localdomain.zone test.com.zone
cp -p localdomain.zone linux.com.zone
cp -p named.local 192.168.1.zone

#test.com.zone

$TTL    86400
@               IN SOA  @       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           @
                IN A            127.0.0.1
                IN AAAA         ::1
wwwtest         IN A            192.168.1.122
dnstest         IN A            192.168.1.133
mytest3         IN A            192.168.1.144


#linux.com.zone

$TTL    86400
@               IN SOA  @       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           @
                IN A            127.0.0.1
                IN AAAA         ::1
wwwtest         IN A            192.168.1.123
dnstest         IN A            192.168.1.134
mytest3         IN A            192.168.1.145


#192.168.1.zone

$TTL    86400
@               IN SOA  @       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           @
                IN A            127.0.0.1
                IN AAAA         ::1
192.168.1.123   IN A            wwwtest
192.168.1.134   IN A            dnstest         
192.168.1.145   IN A            mytest3       

二:重新启动named服务

service named restart

相关推荐