Centos7 DNS服务
2018-09-16 本文已影响12人
wuzsheng
DNS解析
安装bind
yum -y install bind-chroot
systemctl restart named
systemctl enable named
修改主配置文件
vim /etc/named.conf
options {
listen-on port 53 { any; }; #监听的端口的ip(ip可多个,any表示所有)
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";
allow-query { any; }; #允许dns查询的客户机列表any表示所有
配置区域数据信息
vim /etc/named.rfc1912.zones
zone "linuxprobe.com" IN { \\直接在末尾追加
type master;
file "linuxprobe.com.zone";
allow-update { none; };
};
配置解析数据信息
cd /var/named
ls -al named.localhost
cp -a named.localhost linuxprobe.com.zone
vim linuxprobe.com.zone
- systemctl restart named
检查解析结果
nslookup
>www.linuprobe.com
若解析不成功
vim /etc/resolv.conf
nameserver 192.168.18.10
反向解析
配置区域数据信息
vim /etc/named.rfc1912.zones
zone "18.168.192.in-addr.arpa" IN {
type master;
file "192.168.18.arpa";
};
配置解析数据信息
cp -a named.loopback 192.168.18.arpa
vim 192.168.18.arpa
- systemctl restart named
检查解析结果
nslookup
192.168.18.10