DNS主服务器搭建
安装DNS服务
yum install bind
修改namd.conf配置文件监听本机所有IP地址,并且允许所有人来解析
cat /etc/named.conf
options {
listen-on port 53 { localhost;};
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { any; };
配置/var/named/lmy.com.zone文件来解析该域的解析
[root@centos ~]# cat /var/named/lmy.com.zone
$TTL 1D
@ IN SOA aaa.lmy.com. admin.mail.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS aaa
aaa A 192.1.1.10
master A 1.1.1.1
www CNAME web
web A 2.2.2.2
配置/etc/named.rfc1912.zones文件 添加zone
[root@centos ~]# cat /etc/named.rfc1912.zones
zone "lmy.com"{
type master;
file "lmy.com.zone";
};
检查conf文件和zone文件是否格式出错
named-checkconf
[root@centos ~]# named-checkzone lmycom /var/named/lmy.com.zone
zone lmycom/IN: loaded serial 0
OK
测试