db.0 db.127 db.255 db.empty db.local db.rev db.root named.conf
named.conf.local named.conf.options rndc.key
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
zone "." {
type hint;
file "/etc/bind/db.root";
};
// broadcast zones as per RFC 1912
type master;
file "/etc/bind/db.local";
};
type master;
file "/etc/bind/db.127";
};
type master;
file "/etc/bind/db.0";
};
type master;
file "/etc/bind/db.255";
};
文件/etc/bind/named.conf.options的内容如下:
directory "/var/cache/bind";
// to talk to, you might need to uncomment the query-source
// directive below. Previous versions of BIND always asked
// questions using port 53, but BIND 8.1 and later use an unprivileged
// port by default.
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// 0.0.0.0;
// };
//
// Do any local configuration here
//
// organization
//include "/etc/bind/zones.rfc1918";
从以上内容可以看出,除DNS的本地域名外,其它部分已经正常。要增加本地域名解析只要编辑/etc/bind/named.conf.local,并增加相应记
这时可以作一些测试。笔者的测试环境如下:三台电脑,一台装debian,一台装redhat8,一台装win98,准备设置根域名为home,
debian.home 192.168.10.103
win98.home 192.168.10.102
rh8.home 192.168.10.101
domain home.
nameserver 202.101.98.54
### etherconf DEBCONF AREA. DO NOT EDIT THIS AREA OR INSERT TEXT BEFORE IT.
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
192.168.10.103 debian.home debian
### END OF DEBCONF AREA. PLACE YOUR EDITS BELOW; THEY WILL BE PRESERVED.
192.168.10.102 win98.home win98
192.168.10.101 winme.home winme
192.168.10.103 debian.home debian
192.168.10.102 win98.home win98
192.168.10.101 winme.home winme
修改/etc/resolve.conf的内容如下:
domain home.
nameserver 192.168.10.103
### etherconf DEBCONF AREA. DO NOT EDIT THIS AREA OR INSERT TEXT BEFORE IT.
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
192.168.10.103 debian.home debian
### END OF DEBCONF AREA. PLACE YOUR EDITS BELOW; THEY WILL BE PRESERVED.
在win98电脑上删除/windows/hosts文件。并打开控制面板,选网络,再选TCP/IP,在“首选DNS”里面,输入DNS为192.168.10.103,点
即编辑/etc/bind/named.conf.local,并增加相应记录文件。
再次点击创建主区域,在出现的新建主区域选项中的区域类型单选框选反向(地址至名称),在域名 / 网络编辑框中输入192.168.10,在主服务器
但我们需要进一步知道webmin-bind作了哪些修改。
这时的/etc/bind/named.conf的内容如下:
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
zone "." {
type hint;
file "/etc/bind/db.root";
};
// broadcast zones as per RFC 1912
type master;
file "/etc/bind/db.local";
};
type master;
file "/etc/bind/db.127";
};
type master;
file "/etc/bind/db.0";
};
type master;
file "/etc/bind/db.255";
};
zone "home" {
type master;
file "/var/cache/bind/home.hosts";
};
type master;
file "/var/cache/bind/192.168.10.rev";
};
我们可以发现只是末尾增加了两个zone。而且在/etc/bind/目录下的其它文件都没有改动,我们可以从文件的修改时间看出。
增加的两个记录文件是
/var/cache/bind/home.hosts
/var/cache/bind/192.168.10.rev。
/var/cache/bind/home.hosts的内容如下:
$ttl 38400
home. IN SOA debian.home. root.debian.home. (
1039102090
10800
3600
604800
38400 )
home. IN NS debian.home.
debian.home. IN A 192.168.10.103
rh8.home. IN A 192.168.10.101
win98.home. IN A 192.168.10.102
/var/cache/bind/192.168.10.rev的内容如下:
$ttl 38400
10.168.192.in-addr.arpa. IN SOA debian.home. root.debian.home. (
1039102453
10800
3600
604800
38400 )
10.168.192.in-addr.arpa. IN NS debian.home.
101.10.168.192.in-addr.arpa. IN PTR rh8.home.
102.10.168.192.in-addr.arpa. IN PTR win98.home.
103.10.168.192.in-addr.arpa. IN PTR debian.home.