Google

笔记分类

2008年10月28日星期二

linux下用bind9配置dns服务器

linux下bind9配置dns服务器——xxh

1.安装bind9:

sudo apt-get install bind9

2.修改named.conf.local文件:

zone "local.com" {
type master;
file "/etc/bind/db.local.com";
};
zone "206.10.10.in-addr.arpa" {
type master;
file "/etc/bind/db.10.10.206";
};


3.创建db.local.com文件:


$TTL 604800
@ IN SOA local.com. root.local.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS local.com.
@ IN A 10.10.206.1
www IN A 10.10.206.1
xxh IN A 10.10.206.105

3.创建db.10.10.206文件:

$TTL 604800
@ IN SOA local.com. root.local.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS local.com
1 IN PTR local.com
105 IN PTR xxh.local.com

4.修改本机dns:

sudo vi /etc/resolv.conf

search local.com
nameserver 10.10.206.1

5.重启bind:

sudo /etc/init.d/bind9 restart

6.查看是否成功:

nslookup www.local.com

若返回:

xxh@root:/etc/bind$ nslookup www.local.com
Server: 10.10.206.1
Address: 10.10.206.1#53

Name: www.local.com
Address: 10.10.206.1

配置成功。

没有评论:

发表评论