小弟这周在我的Linux(Linux 1.3.61, IBM PS 486/66, 16M Ram)上做了一个 DNS Primary Server,现将方法Post上来,希望对大家有所帮助,也欢迎大家来信指教.
1. 首先应确认你的上级域名服务器已正确指向你的DNS Server, 如我设置的子域为net.dlut.edu.cn,则应在dlut.edu.cn的域名服务器上有到Linux的NS记录,以下是在dlut.edu.cn域名服务器相应文件内容:
--------------------------/etc/named.boot----------------------
directory /etc/namedb
;
primary dlut.edu.cn hosts.db
primary 66.118.202.in-addr.arpa hosts.rev
;
;
primary 0.0.127.in-addr.arpa named.local
secondary net.dlut.edu.cn 202.118.65.1 nethost.db
secondary 65.118.202.in-addr.arpa 202.118.65.1 nethost.rev
;
; load the cache data last
cache . named.ca
-------------------------/etc/namedb/hosts.db-------------------
..
net IN NS gw.net.dlut.edu.cn.
IN A 202.118.66.3
IN A 202.118.65.1
IN NS cedrus.dlut.edu.cn.
可通过nslookup 确认是否已正确设定,如下:
/etc/namedb[5]nslookup -q=NS
Default Server: localhost
Address: 127.0.0.1
> net.dlut.edu.cn
Server: localhost
Address: 127.0.0.1
net.dlut.edu.cn nameserver = gw.net.dlut.edu.cn
net.dlut.edu.cn nameserver = cedrus.dlut.edu.cn
net.dlut.edu.cn nameserver = gw.net.dlut.edu.cn
net.dlut.edu.cn nameserver = cedrus.dlut.edu.cn
gw.net.dlut.edu.cn inet address = 202.118.66.3
gw.net.dlut.edu.cn inet address = 202.118.65.1
cedrus.dlut.edu.cn inet address = 202.118.66.6