Linux ,c/c++, web,前端,php,js
分类: LINUX
2011-08-10 18:46:32
本文所说方法为yum安装,使用name caching方式。其他方法后续有机会再补完吧
01、首先使用yum方式安装所需的程序包:yum install bind bind-chroot caching-nameserver -y
02、进入bind的目录,并复制控制文件:
cd /var/named/chroot/etc;
cp named.caching-nameserver.conf named.conf
03、编辑named.conf文件:vi named.conf
options { listen-on port 53 { any; }; 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"; forwarders { 8.8.8.8; 202.106.0.20; }; // Those options should be used carefully because they disable port // randomization // query-source port 53; // query-source-v6 port 53; allow-query { any; }; allow-query-cache { any; }; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; view localhost_resolver { match-clients { any; }; match-destinations { any; }; recursion yes; include "/etc/named.rfc1912.zones"; };04、编辑vi named.rfc1912.zones
如果是主DNS
如果是辅DNS
zone "abc.com" { type slave; file "abc.com.zone"; Masters{192.168.1.1;}; }; zone "33.22.11.in-addr.arpa" { type slave; file "11.22.33.rev"; Masters{192.168.1.1;}; };05、编辑上面配置文件中提到的abc.com.zone文件
cd /var/named/chroot/var/named
vi abc.com.zone
06、启动服务:service named start
07、将服务设置为开机自启
08、至此域名服务器基本搭建完成了~