RHEL 6.4 安装DNS服务(bind-9.8 )
首先安装yum,使用yum安装bind
yum install bind*
不同的操作系统rpm包有可能会不同 bind-9.8.2-0.17.rc1.el6.x86_64 bind-utils-9.8.2-0.17.rc1.el6.x86_64 bind-chroot-9.8.2-0.17.rc1.el6.x86_64 bind-dyndb-ldap-2.3-2.el6.x86_64 bind-libs-9.8.2-0.17.rc1.el6.x86_64
几个rpm包安装之后,编辑named.conf
vim /etc/named.conf
options { listen-on port 53 { 127.0.0.1; }; listen-on-v6 port 53 { ::1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; allow-query { localhost; }; recursion yes;
dnssec-enable yes; dnssec-validation yes; dnssec-lookaside auto;
/* Path to ISC DLV key */ bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic"; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; };
zone "." IN { type hint; file "named.ca"; }; ;此处为自定义的域名 zone "linuxidc.com" IN { type master; file "named.linuxidc.com";
};
zone "1.168.192.in-addr.arpa" IN { type master; file "named.192.168.1"; };
include "/etc/named.rfc1912.zones"; include "/etc/named.root.key";
:wq 保存退出
cd /var/named/
vim named.linuxidc.com
$TTL 3600 @ IN SOA demo.linuxidc.com. root.linuxidc.com. ( 2014102401 1H 5M 1W 1D ) @ IN NS demo.linuxidc.com. @ IN MX 10 mail.linuxidc.com. mail IN A 192.168.123.200 demo IN A 192.168.123.200 www IN A 192.168.123.200 ftp IN CNAME demo.linuxidc.com. :wq
vim named.192.168.1
$TTL 3600 @ IN SOA demo.linuxidc.com. root.linuxidc.com. ( 2014102402 1H 5M 1w 1D ) @ IN NS demo.linuxidc.com. 200 IN PTR demo.linuxidc.com. 200 IN PTR mail.linuxidc.com. 200 IN PTR www.linuxidc.com. 200 IN PTR ftp.linuxidc.com.
service named restart 重启DNS服务 Stopping named: [ OK ] Starting named: [ OK ] DNS服务已经正常启动。。。。。。。。。。。。。。。。。。。。。。。。。。
验证DNS服务:
[root@demo named]# nslookup > linuxidc.com