在安装ORACLE RAC的时候碰到DNS配置问题,看了DNS & BIND之后,小配了一下,一大堆BIND配置错误,网上有一哥们,估计是老外,碰到的问题差不多,摘录下:http://itcaffe.net/fix-default-bind-install-on-centos/
1。 Locating
/var/named/chroot//etc/named
.conf failed:
一开始这个问题很相似,看了DNS & BIND之后,有点名目了,BIND需要配置named.conf和2类zone data file:
a) named.conf是named也就是DNS需要读取的配置文件,通常在/etc/named.conf, 也可以是在/var/named/chroot/etc/named.conf
b) 第一类zone data file 是name mapped to address,也就是forward-mapping file,根据名字翻译IP地址;
c) 第二类zone data file 是address mapped to name, 也就是reverse mapping file,根据地址找名字
2. named.conf 配置
options {
directory "/var/named";
};
zone "smartoffice.com" in {
type master;
file "db.smartoffice.com";
};
zone "226.168.192.in-addr.arpa" in {
type master;
file "db.192.168.226";
};
-- zone data file (Address mapped to NAMES)
226.168.192.in-addr.arpa. IN SOA rac01.smartoffice.com rac02.smartoffice.com(
1 ;serial
3h ;refresh after 3 hours
1h ;retry after 1 hour
1w ;expire after 1 week
1h) ;negative caching TTL of 1 hour
;
;NS Records
;
226.168.192.in-addr.arpa. IN NS rac01.smartoffice.com
;
-- zone data file (Names mapped to Addresses)
smartoffice.com. IN SOA rac01.smartoffice.com. rac02.smartoffice.com.(
1 ;serial
3h ;refersh after 3 hours
1h ;retry after 1 hour
1w ;expire after 1 week
1h) ;negative caching TTL of 1 hour
;
;NS Records:
;
smartoffice.com. IN NS rac01.smartoffice.com.
smartoffice.com. IN NS rac02.smartoffice.com.
;
;Host Addresses
;
localhost.smartoffice.com. IN A 127.0.0.1
rac01.smartoffice.com. IN A 192.168.226.146
rac02.smartoffice.com. IN A 192.168.226.149
;
;multi-home hosts
;none
;host addresses:
;
146.226.168.192.in-addr.arpa. IN PTR rac01.smartoffice.com
149.226.168.192.in-addr.arpa. IN PTR rac02.smartoffice.com
3 从上面的配置文件,看得出来,
3.1 ;冒号是代表注释(在zone data file中),
3.2 基本的zone data file 格式:
SOA Record
NS Record
Other Records
A : name to address mapping (名字翻译地址)
PTR:(POINTER) address to name mapping(地址翻译名字)
CNAME: 别名