BIND一览
=====================================================================
. 后台进程:named
. 脚本:/etc/rc.d/init.d/named
. 使用端口:53 (tcp,udp)
. 所需RPM包:bind,bind-utils
. 相关RPM包:caching-nameserver,bindconf
. 配置文件:/etc/named.conf
. 相关路径:/var/named (或/var/named/chroot/var/named)
=====================================================================
。BIND可配置
主域 (type master)
从域 (type slave)
缓冲域
。named.conf主域语段
正向解释
zone "saeg.com.cn" IN {
type master;
file "saeg.com.cn.zone";
};
反向解释
zone "1.168.192.in-addr.arpa" IN {
type master;
file "192.168.1.zone";
};
saeg.com.cn.zone文件内容
$TTL 86400
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS saeg.com.cn.
IN MX 10 mail.saeg.com.cn.
test IN A 192.168.1.2
richard IN A 192.168.1.117
www IN CNAME test
mail IN CNAME test
smtp IN CNAME test
pop IN CNAME test
192.168.1.zone文件内容
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS saeg.com.cn.
2 IN PTR test.saeg.com.cn.
2 IN PTR mail.saeg.com.cn.
2 IN PTR .
2 IN PTR smtp.saeg.com.cn.
2 IN PTR pop.saeg.com.cn.
117 IN PTR richard.saeg.com.cn.
说明:
1.IN 前后均有空格;
2.file后面的域文件的位置依赖/etc/sysconfig/named中参数 ROOTDIR=/var/named/chroot,默认情况下存放在/var/named/chroot/var/named下,不过最好把/etc/sysconfig/named中参数注释掉,让域文件存放在/var/named/下
。资源记录
>SOA 定义起始授权
>NS 指定域名服务器
>MX 指定邮件服务器
>A 将域名解析成其后的IP
>CNAME 设置域名的别名
>PTR 将IP地址指向一个域名
。检查named.conf语法
[root@test chroot]# named-checkconf
。检查域文件语法
[root@test chroot]# named-checkzone saeg.com.cn.zone /var/named/saeg.com.cn.zone
dns_master_load: /var/named/saeg.com.cn.zone:13: ignoring out-of-zone data (test.saeg.com.cn)
zone saeg.com.cn.zone/IN: loaded serial 42
OK
-----------------
[root@test chroot]# named-checkzone 192.168.1.zone /var/named/192.168.1.zone
zone 192.168.1.zone/IN: loaded serial 1997022700
OK
。/etc/resolv.conf文件内容
[root@test chroot]# cat /etc/resolv.conf
nameserver 192.168.1.2 (DNS服务器的IP,本例就是自己承担DNS服务器)
阅读(1288) | 评论(0) | 转发(0) |