apt-get install bind9
Ubuntu 8.04 server DNS配置
#vi /etc/bind/named.conf
加入:
zone "wenxuann.cn" {
type master;
file "/etc/bind/wenxuann.cn";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/1.168.192";
};
2.设置区域文件
#vi /etc/bind/wenxuann.cn
$TTL 604800
@ IN SOA . root.wenxuann.cn. ( //本区域的起始授权机构
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS . //本区域的权威DNS服务器
IN A 192.168.1.8
www IN A 192.168.1.8
hi IN A 192.168.1.8
www2 IN CNAME www
#vi /etc/bind/1.168.192
$TTL 604800
@ IN SOA . root.wenxuann.cn. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS .
8 IN PTR . //反向解析
9 IN PTR www3.cody.cn.
3.重启DNS服务器
#sudo /etc/init.d/bind9 restart
4.设置DNS服务器地址
#sudo vi /etc/resolv.conf
nameserver 192.168.1.8
5.测试DNS解析
#nslookup
#nslookuo 192.168.1.8
阅读(1058) | 评论(1) | 转发(0) |