- 先挂载镜像,然后配置yum,然后安装yum install -y bind
- 配置静态 IP.DNS就是他本身的IP地址.
- 修改DNS的配置文件,在后面加入区域配置信息。vim /etc/named.conf
- zone "tcbuu.cn" IN {
type master;file "tcbuu.cn.zone";
};
zone "227.168.192.in-addr.arpa" IN {
type master;
file "227.168.192.in-addr.arpa.zone";
};
5.在/var/named/路径下创建两个和配置文件相同名字的文件
6. 可以直接拷贝/var/named/目录下的两个样本文件进行修改
- cp -p named.loopback 227.168.192.in-addr.arpa.zone
- cp -p named.localhost tcbuu.cn.zone
- 7.tcbuu.cn.zone
$TTL 1D@ IN SOA tcbuu.com. root.tcbuu.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS www.tcbuu.com.
www A 172.16.100.192
8.227.168.192.in-addr.arpa.zone
$TTL 1D
@ IN SOA 100.16.172.in-addr.arpa. root.tcbuu.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ NS www.tcbuu.com.
A 127.0.0.1
AAAA ::1
195 PTR www.tcbuu.com.
9.vi /etc/resolv.conf 更改DNS地址为本机IP
10.service named restart 重启服务测试
时间: 2024-11-05 21:52:44