|
redhat9.0,只有一块网卡,网卡接hub通过adsl猫上网,机子又虚拟了三块网卡,
分别做ftp,mail,www如下
eth0 192.168.0.46 dns
eth0:1 192.168.0.51 ftp
eth0:2 192.168.0.52 mail
eth0:3 192.168.0.53 www
看了xchen兄的配置方法 http://www.linuxsir.cn/forum.php?mod=viewthread&tid=4138
全部配置文件自认为无误后,重启named,nslookup测试,失败!于是删掉所以配置文件,重新看原文,再配置,再测试,失败!昏 ,再重配一次,还是失败,想跳楼了:mad:
后参照syd168兄的图形界面配置方法,成 功,OK!http://www.linuxsir.cn/forum.php ... 1&highlight=dns
再一次参照xchen兄直接配置dns文件,还是失败,搜索论坛,发现一条,redhat7.2以上BIND,需建 立named用户,以named用户的权限来执行named,
named -u named,一试,重启named,nslookup测试,行了~~~;)
以下是配置文件:
和一点都不明白的几个问题
域kerom.com
正向解析文件named.hosts
反向解析文件named.re
named.conf
// generated by named-bootconf.pl
options {
directory "/var/named";
/*
* 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 "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "kerom.com" IN {
type master;
file"named.hosts";
};
zone "0.168.192.in-addr.arpa"IN {
type master;
file "named.re";
};
include "/etc/rndc.key";
named.hosts
$TTL 86400
@ IN SOA dns.kerom.com. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS dns.kerom.com.
@ IN MX 5 mail.kerom.com.
dns IN A 192.168.0.46
ftp IN A 192.168.0.51
mail IN A 192.168.0.52
www IN A 192.168.0.53
ns IN CNAME dns.kerom.com.
问题:NS和MX前的@符号是什么意思,测试后发现可以加@ 也不以不加@,为什么么?
named.re
$TTL 86400
@ IN SOA dns.kerom.com. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS dns.kerom.com.
46 IN PTR dns.kerom.com.
51 IN PTR ftp.kerom.com.
52 IN PTR mail.kerom.com.
53 IN PTR www.kerom.com.
named.local
$TTL 86400
@ IN SOA dns.kerom.com. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS dns.kerom.com.
1 IN PTR localhost.
localhost.zone
$TTL 86400
@ IN SOA @ root.localhost (
4 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttl
)
IN NS localhost.
@ IN A 127.0.0.1
问题:为何这边的SOA记录后是@, 而不要改为dns.kerom.com.而named.local却要改,测试后发现这里改为dns.kerom.com.也行,这是什么原因??
resolv.conf
# MADE-BY-RP-PPPOE
nameserver 192.168.0.46
domain kerom.com
search localdomain
我发现重启后,这个文件并没有被adsl自动获得的dns重写,呵呵,这样好,省得改那天书一样的脚本了。 |
|