DNS配置笔记

第1步 建/etc/named.conf文件
// generated by named-bootconf.pl

options {
??? directory "/var/named";
??? forward first;
??? forwarders {202.96.107.22;202.101.172.36;};
??? /*
????* If there is a firewall between you and nameservers you want
????* to talk to, you might need to uncomment the query-source
????* directive below.?Previous versions of BIND always asked
????* questions using port 53, but BIND 8.1 uses an unprivileged
????* port by default.
????*/
??? // query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
??? inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
??? type hint;
??? file "named.ca";
};

zone "localhost" IN {
??? type master;
??? file "localhost.zone";
};

zone "0.0.127.in-addr.arpa" IN {
??? type master;
??? file "named.local";
};
zone "sxszjzx.com" IN {
??? type master;
??? file "sxszjzx.com.zone";
};

include "/etc/rndc.key";


第2步:建/var/named/sxszjzx.com.zone 文件

$TTL 86400
@??? IN???SOA?? server1.sxszjzx.com.?root.server1.sxszjzx.com. (
???????20040922? ; serial 注意此行与上行为同一行
???????28800???; refresh (8 hours)
???????7200??? ; retry (2 hours)
???????604800?? ; expire (1 week)
???????86400???; minimum (1 day)
???????)
??????? NS???server1.sxszjzx.com.
??????? MX 5??server1.sxszjzx.com.


server1???? A??? 172.18.0.5
www?????? CNAME? server1
ftp?????? CNAME? server1
mail??????CNAME? server1
pop?????? CNAME? server1
pop3??????CNAME? server1
smtp??????CNAME? server1

gateway????????A??? 172.18.0.4
backup???????? A??? 172.18.0.3
server3????????A??? 172.18.0.6