(5) /var/named/named.hosts
说明如下:
; named.hosts - dns file
;
; SOA rec
so.unis. IN SOA dns.so.unis. root.dns.so.unis. (
;SOA记录,
;dns.so.unis为DNS对应的主机
;root.dns.so.unis为主机的管理员用户为root
;以上的域、主机及用户后均需要跟上点
1998120816 ;dns序列号,可以使用年月日时
10800 ;refresh after 3 hours
10800 ;retry after 3 hour
604800 ;expire after 1 week
86400) ;minimum TTL of 1 day
so.unis. IN NS dns.so.unis.
;name server
;以下为主机/地址对应表
dns.so.unis. IN A 192.168.99.1
localhost IN A 127.0.0.1
dbserver.so.unis. IN A 192.168.99.2
www.so.unis. IN A 192.168.99.3
mail.so.unis. IN A 192.168.99.4
ftp.so.unis IN A 192.168.99.3
;mail exchange
so.unis IN MX 1 mail.so.unis.
(6) /var/named/named.local
; named.local - dns file
;
; SOA rec
0.0.127.in-addr.arpa. IN SOA dns.so.unis. root.dns.so.unis. (
1998120816 ;serial number
10800 ;refresh after 3 hours
10800 ;retry after 3 hour
604800 ;expire after 1 week
86400) ;minimum TTL of 1 day
;name server
0.0.127.in-addr.arpa. IN NS dns.so.unis.
1.0.0.127.in-addr.arpa. IN PTR localhost
(7) /var/named/named.rev
; named.rev - dns file
;
; SOA rec
99.168.192.in-addr.arpa. IN SOA dns.so.unis. root.dns.so.unis. (
19981208 ;serial number
10800 ;refresh after 3 hours
10800 ;retry after 3 hour
604800 ;expire after 1 week
86400) ;minimum TTL of 1 day
;name server
99.168.192.in-addr.arpa. IN NS dns.so.unis.
1.99.168.192.in-addr.arpa. IN PTR dns.so.unis.
( /var/named/named.ca
; named.ca - dns cache file
;
@ IN SOA dns.so.unis. root.dns.so.unis. (
1998120815 ;serial number
10800 ;refresh after 3 hours
3600 ;retry after 3 hour
604800 ;expire after 1 week
86400) ;minimum TTL of 1 day
;
dns.so.unis. 999999 IN A 192.168.99.1
99.168.192.in-addr.arpa. IN NS so.unis.
dns.so.unis. IN A 192.168.99.1
4. 配置文件示例
温州瓯海法院DNS配置:
域名为:oh.wz.zj,主子网为203.3.6.0,DNS地址为203.3.6.1,主机名为"ohfy"。
文件内容如下:
(1) /etc/defaultdomain
oh.wz.zj
(2) /etc/nsswitch.conf
#
# /etc/nsswitch.files:
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
passwd: files
group: files
hosts: dns files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn\'t a \'files\' backend for netgroup; the system will
# figure it out pretty quickly, and won\'t use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
sendmailvars: files
(3) /etc/resolv.conf
;
; /etc/resolv.conf file for dnsmaster (E450)
; written in 1998-12-8, UNIS
;
domain oh.wz.zj ;This domain name
nameserver 203.3.6.1 ;this domain name server
;nameserver 202.x.x.x ;parent dns server
(4) /etc/named.boot
;
; /etc/named.boot file for dnsmaster (E450)
; written in 1998-12-8, UNIS
;
directory /var/named
cache . named.ca ;dns cache file
primary oh.wz.zj named.hosts ;dns host file
;secondary wz.zj 202.x.x.x
primary 0.0.127.in-addr.arpa named.local ;local dns file
primary 6.3.203.in-addr.arpa named.rev ;named rev file
(5) /var/named/named.ca
;
; named.ca - dns cache file
; written in 1998-12-8, tusc
;
@ IN SOA ohfy.oh.wz.zj. root.ohfy.oh.wz.zj. (
1998120815 ;serial number
10800 ;refresh after 3 hours
3600 ; retry after 3 hour
604800 ; expire after 1 week
86400) ; minimum TTL of 1 day
;
ohfy.oh.wz.zj. 999999 IN A 203.3.6.1
;
;wz. IN NS oh.wz.
6.3.203.in-addr.arpa. IN NS oh.wz.zj.
ohfy.oh.wz.zj. IN A 203.3.6.1
(6) /var/named/named.hosts
;
; db.oh - dns file
; written in 1998-12-8, tusc
;
;
; SOA rec
oh.wz.zj. IN SOA ohfy.oh.wz.zj. root.ohfy.oh.wz.zj. (
1998120816 ;serial number
10800 ;refresh after 3 hours
10800 ; retry after 3 hour
604800 ; expire after 1 week
86400) ; minimum TTL of 1 day
;name server
oh.wz.zj. IN NS ohfy.oh.wz.zj.
;address
ohfy.oh.wz.zj. IN A 203.3.6.1
localhost IN A 127.0.0.1
dbserver.oh.wz.zj. IN A 203.3.6.1
www.oh.wz.zj. IN A 203.3.6.1
mail.oh.wz.zj. IN A 203.3.6.1
ftp IN A 203.3.6.1
;wz.zj. IN A 202.x.x.x ;parent dns server
;mail exchange
oh.wz.zj IN MX 1 mail.oh.wz.zj.
(7) /var/named/named.local
;
; named.local - dns file
; written in 1998-12-8, tusc
;
; SOA rec
0.0.127.in-addr.arpa. IN SOA ohfy.oh.wz.zj. root.ohfy.oh.wz.zj. (
1998120816 ;serial number
10800 ;refresh after 3 hours
10800 ;retry after 3 hour
604800 ;expire after 1 week
86400) ;minimum TTL of 1 day
;name server
0.0.127.in-addr.arpa. IN NS ohfy.oh.wz.zj.
1.0.0.127.in-addr.arpa. IN PTR localhost
( /var/named/named.rev
;
; oh.rev - dns file
; written in 1998-12-8, tusc
;
; SOA rec
6.3.203.in-addr.arpa. IN SOA ohfy.oh.wz.zj. root.ohfy.oh.wz.zj. (
19981208 ;serial number
10800 ;refresh after 3 hours
10800 ;retry after 3 hour
604800 ;expire after 1 week
86400) ;minimum TTL of 1 day
;name server
6.3.203.in-addr.arpa. IN NS ohfy.oh.wz.zj.
1.6.3.203.in-addr.arpa. IN PTR ohfy.oh.wz.zj.