1:安装DNS服务
yum install bind -y
2:修改/etc/named.conf 配置文件
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
allow-query { any; };
allow-query-cache { any; };
#添加的正向解析
zone "b.com" IN {
type master;
file "b.com.zone";
allow-transfer { none;};
allow-transfer { any; } #允许转发
};
3:在/var/name/目录下添加一个文件:
vi b.com.zone
$TTL 1D
@ IN SOA b.com. root (
42 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
www IN A 172.30.7.3
bbs IN A 172.30.7.3
4:在测试服务器上绑定DNS的IP ,即可
5:这时候就可以ping通www.b.com/bbs.b.com了