您查看的文章来源于http://www.oklinux.cn
有两台邮件服务器分别为192.168.1.1(windows下主机名为b.test.cn)和192.168.1.3(linux下主机名为a.test.com)。
在linux下配置DNS服务器,下面是配置过程中设置过的一些文件,
/etc/hosts 文件的具体内容如下:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost fc4
192.168.1.3 a.test.com a
192.168.1.1 b.test.cn b
/etc/host.conf 文件:
order hosts,bind
表示先用hosts文件做解析,在用DNS解析
/etc/resolv.conf 文件:
; generated by NetworkManager, do not edit!
search test.com
nameserver 127.0.0.1
search test.cn
nameserver 192.168.1.1
nameserver 61.144.56.100
/etc/named.conf 文件:
//
// named.conf for Red Hat caching-nameserver
//
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
/*
* If there is a firewall between you and nameservers you want
* 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 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "test.com"IN {
type master;
file "test.com";