1. 编辑/etc/named.conf
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* 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 "mydomain.com" IN {
type master;
file "named.mydomain.com";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "named.mydomain.com.rev";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
include "/etc/rndc.key";
2. 编辑正向解析文件/var/named/named.mydomain.com
$TTL 86400
@ IN SOA my.mydomain.com. root.my.mydomain.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS my.mydomain.com.
IN MX 10 my.mydomain.com.
my IN A 192.168.1.50
www IN CNAME my.mydomain.com.
ftp IN CNAME my.mydomain.com.
smtp IN CNAME my.mydomain.com.
pop3 IN CNAME my.mydomain.com.
3. 编辑反向解析文件/var/named/named.mydomain.com.rev
$TTL 86400
@ IN SOA my.mydomain.com. root.ns.mydomain.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS my.mydomain.com.
50 IN PTR my.mydomain.com.
4. 编辑/var/named/named.local文件
$TTL 86400
@ IN SOA my.mydomain.com. root.my.mydomain.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS my.mydomain.com.
1 IN PTR localhost.
5. 编辑/etc/resolv.conf
# MADE-BY-RP-PPPOE
domain mydomain.com
nameserver 192.168.1.50
search localdomain