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 "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; };
};
/////////////////////////////////////
zone "138.52.61.in-addr.arpa" IN { //为本机外网IP 61.52.138.200
type master;
file "db.61.52.138.200";
allow-update { none; };
};
zone "mydns.com" IN { //为本机域名 (本机名也为mydns)
type master;
file "mydns.com.db";
allow-update { none; };
};
$TTL 86400
@ IN SOA 61.52.138.200 maa.ydns.com. (
2003050200 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ); Minimum
IN NS www.mydns.com.
200 IN PTR www
//mydns.com.db
$TTL 86400
@ IN SOA www.mydns.com. aaa.mydns.com. (
2003050200 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ); Minimum
IN NS www.mydns.com.
localhost IN A 127.0.0.1
www IN A 61.52.138.200
[root@java named]# nslookup
Note: nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead. Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
> mydns.com
Server: 61.52.138.200
Address: 61.52.138.200#53