网络环境
Hostname: zhengwing.org; mail.zhengwing.org; pop3.zhengwing.org; smtp.zhengwing.org.
IP add:192.168.254.123/24
Defaultgw:192.168.254.2
DNS server:192.168.254.2(Replace IP address to 192.168.254.123 when set completed.)
1、USE=”dlz” emerge –av bind
2、Emerge –av bind-tools
3、Vi /etc/bind/named.conf
|
options{ directory "/var/bind"; listen-on-v6 { none; }; listen-on {192.168.254.123;}; pid-file "/var/run/named/named.pid"; }; zone "." IN{ type hint; file "named.ca"; }; zone "localhost" IN{ type master; file "pri/localhost.zone"; allow-update {none;}; notify no; }; zone "127.in-addr.arpa" IN { type master; file "pri/127.zone"; allow-update {none;}; notify no; };
|
4.vi /etc/resolv.conf
|
Nameserver 192.168.254.2
|
5.dig –t NS

6.拷贝根目录IP添加到/etc/resolv.conf
格式为:nameserve r198.41.0.4
Nameserver192.228.79.201
…………………………………
Nameserver192.36.148.17
7.dig –t NS . > /var/bind/named.ca
Vi /var/bind/named.ca 如下图

8.vi /etc/resolv.conf
|
Nameserver 127.0.0.1 #:Nameserver 192.168.254.123 #删除其他的NAMESERVER
|
9./etc/init.d/named restart
10.测试
Host www.gentoo.org

如图,正向与反向解析成功。
11.添加邮件服务器域名解析功能
11.1 vi /etc/bind/named.conf
#添加一下内容
|
zone "zhengwing.org" IN{ type master; file "pri/zhengwing.org.zone"; allow-update {none;}; notify no; }; zone "192.in-addr.arpa" IN { type master; file "pri/zhengwing.org_reverse.zone"; allow-update {none;}; notify no; };
|
11.2添加解析文件
Cd /var/bind/pri
Vi zhengwing.org.zone
|
*$TTL 1W @INSOAzhengwing.orgroot.zhengwing.org.( 2010091808 ; Serial 28800; Refresh 14400; Retry 604800; Expire - 1 week 86400 ); Minimum @INNSzhengwing.org. @INA192.168.254.123
mailINCNAME zhengwing.org. smtpINCNAMEzhengwing.org. pop3INCNAMEzhengwing.org. @INMX 5mail.zhengwing.org
|
Vi zhengwing.org_reverse.zone
|
*$ORIGIN 192.in-addr.arpa. $TTL 1W @1D IN SOAzhengwing.orgroot.zhengwing.org. ( 2010092204; serial 3H; refresh 15M; retry 1W; expiry 1D ); minimum
@1D IN NSzhengwing.org.
123.254.1681D IN PTRzhengwing.org. 123.254.1681D IN PTRmail.zhengwing.org. 123.254.1681D IN PTRsmtp.zhengwing.org. 123.254.1681D IN PTRpop3.zhengwing.org.
|
11.3 测试

