Friday, December 16, 2011

Bind9安装设置指南

LINK

step 1: install
$ sudo apt-get install bind9
$ sudo apt-get install bind9-host dnsutils (tools for the test)

step 2: Simply uncomment and edit the cache server, in /etc/bind:

[...]

forwarders {
1.2.3.4;
5.6.7.8;
};

(where 1.2.3.4 and 5.6.7.8 are the IP numbers of your ISP's DNS servers)
(其中 1.2.3.4 和 5.6.7.8 是您 ISP 商 DNS 服务器的 IP。

step 3: edit to let srv to be the master dns.
[...]

zone "example.com" {
type master;
file "/etc/bind/db.example.com";
};

step 4:
Now use an existing zone file as a template
现在使用一个已有域文件作为模板
$ sudo cp /etc/bind/db.local /etc/bind/db.example.com

step 5: edit db.example.com; add 2 entry for the lab.
$TTL 604800
@ IN SOA ns1.qa-test.com. hostmaster.qa-test.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
@ IN A 127.0.0.1
@ IN AAAA ::1
bigsrv A 192.18.9.1
A 192.18.9.2


step 6: restart the bind

$ sudo /etc/init.d/bind9 restart

step 7: test.
host -t aaaa bigsrv.qa-test.com
nslookup > server x.x.x.x > bigsrv.qa-test.com

No comments: