1、安装
10.1.2.214的主机
yum install bind bind-util
2、主配置文件/etc/named.conf
// // named.conf // // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS // server as a caching only nameserver (as a localhost DNS resolver only). // // See /usr/share/doc/bind*/sample/ for example named configuration files. // options { // // named.conf // // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS // server as a caching only nameserver (as a localhost DNS resolver only). // // See /usr/share/doc/bind*/sample/ for example named configuration files. // options { 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"; recursion yes; /* 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"; }; include "/etc/named.rfc1912.zones"; include "/etc/named.root.key";
3、在配置文件/etc/named.rfc1912.zones添加这段
zone "dataeye.com" IN { type master; file "abc.com.zone"; }; zone "2.1.10.in-addr.arpa" IN { type master; file "10.1.2.zone"; };
4、解析库文件在/var/named/目录下
4.1 /var/named/abc.com.zone$TTL 600
@ IN SOA ns.abc.com. admin.abc.com. ( 2016021801 2H 10m 3D 1D ) IN NS ns IN MX 10 mail ns IN A 10.1.2.214 mail IN A 10.1.2.214 wwww IN A 10.1.2.214
4.2 /var/named/10.1.2.zone
$TTL 600 @ IN SOA ns.abc.com. admin.abc.com. ( 2016021801 2H 10m 3D 1D ) IN NS ns.abc.com. 214 IN PTR ns.abc.com. 214 IN PTR mail.abc.com. 214 IN PTR www.abc.com.
4.3 修改属主named和权限640
#chgrp named abc.com.zone 10.1.2.zone #chmod 640 abc.com.zone 10.1.2.zone
5、检查语法
#name-checkzone "abc.com" abc.com.zone #named-checkzone "2.1.10.in-addr.arpa" 10.1.2.zone
6、验证
#dig -t MX abc.com @10.1.2.214 #dig -t A mail.abc.com @10.1.2.214 #dig -x 10.1.2.214 @10.1.2.214
本文出自 “散人” 博客,请务必保留此出处http://zouqingyun.blog.51cto.com/782246/1752690
原文:http://zouqingyun.blog.51cto.com/782246/1752690