客户端IP:192.168.17.10
客户端主机名:rtpserver01.test.com
DNS Server IP:192.168.17.9
一、检查软件安装
blade10:~ # rpm -qa|grep bind
bind-libs-9.5.0P2-20.1
bind-utils-9.5.0P2-20.1
bind-libs-32bit-9.5.0P2-20.1
...
二、检查bind包(package)所对应的相关文件和目录
blade10:~ # rpm -ql bind
/etc/init.d/named
/etc/named.conf #DNS主要配置文件
......
三、启动/停止DNS
blade10:/software # /etc/init.d/named 或 # rcnamed
第一次启动后,自动生成/var/lib/named/etc/named.conf
开机自动启动DNS:blade10:/software # chkconfig named on
四、配置/etc/named.conf文件
blade10:/software # cat /etc/named.conf
....
# localhost while the third defines the reverse lookup for localhost.
...
###新增如下内容,需要解析的主机的domain###
zone "test.com" in {
type master;
file "test.com";
};
zone "17.168.192.in-addr.arpa" in {
type master;
file "192.168.17.zone";
};
###新增内容结束###
五、创建并配置步骤四中在named.conf文件中指定的两个file
blade10:/var/lib/named # pwd
/var/lib/named
blade10:/var/lib/named # cat test.com
$TTL 1W
test.com. IN SOA host.com. root (
42 ; serial (d. adams)
2D ; refresh
4H ; retry
6W ; expiry
1W ) ; minimum
IN NS test.com.
IN A 192.168.17.10
dns IN A 192.168.17.10
www IN A 192.168.17.10
rtpserver01 IN A 192.168.17.10 #对应主机名rtpserver01.test.com
vi IN CNAME rtpserver01.test.com.
blade10:/var/lib/named # cat 192.168.17.zone
$TTL 1W
@ IN SOA test.com. root.localhost. (
42 ; serial (d. adams)
2D ; refresh
4H ; retry
6W ; expiry
1W ) ; minimum
IN NS test.com.
10 IN PTR rtpserver01.test.com.
六、客户端配置
配置或者添加/etc/resolv.conf文件,添加一行:
nameserver 192.168.3.89
阅读(12762) | 评论(0) | 转发(0) |