$ ps -ef | grep named
$ yum install bind # yum下载DNS
$ cd /var/named/
$ vi /var/named/dev.ubaby.cn.zone
$ORIGIN dev.ubaby.cn.
$TTL 60
@ IN SOA dns.dev.ubaby.cn. liwanli.uyoung.com.cn. (
2016012902 ; serial
21600 ; refresh
3600 ; retry
604800 ; expiry
60 ; minimum ttl
)
IN NS 192.168.1.30.
dev.ubaby.cn. 86400 IN NS dns.dev.ubaby.cn.
dns 60 IN A 192.168.1.30
app 60 IN A 192.168.1.30
umedia 60 IN A 192.168.1.30
audio 60 IN A 192.168.1.30
image 60 IN A 192.168.1.30
article 60 IN A 192.168.1.30
operate 60 IN A 192.168.1.30
push 60 IN A 192.168.1.30
urm 60 IN A 192.168.1.30
$ vi /var/named/192.168.1.in-addr.arpa.zone
$ORIGIN 1.168.192.in-addr.arpa.
$TTL 60
@ IN SOA dns.ops.ubaby.cn. liwanli.uyoung.com.cn. (
2016022901 ; serial
21600 ; refresh
3600 ; retry
604800 ; expiry
60 ; minimum ttl
)
1.168.192.in-addr.arpa. 86400 IN NS dns.ops.ubaby.cn.
30 60 IN PTR app.dev.ubaby.cn.
30 60 IN PTR umedia.dev.ubaby.cn.
30 60 IN PTR dns.dev.ubaby.cn.
30 60 IN PTR huodong.dev.ubaby.cn.
30 60 IN PTR audio.dev.ubaby.cn.
30 60 IN PTR image.dev.ubaby.cn.
30 60 IN PTR article.dev.ubaby.cn.
30 60 IN PTR operate.dev.ubaby.cn.
30 60 IN PTR push.dev.ubaby.cn.
30 60 IN PTR urm.dev.ubaby.cn.
$ > /etc/named.conf # 清空文件
$ vi /etc/named.conf
options {
listen-on port 53 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.text";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
recursion yes;
forward first;
forwarders { 202.106.0.20; 219.141.136.10; };
querylog 0;
recursive-clients 50000;
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
include "/etc/named.rfc1912.zones";
$ vi /etc/named.rfc1912.zones
zone "dev.ubaby.cn" IN {
type master;
file "dev.ubaby.cn.zone";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "192.168.1.in-addr.arpa.zone";
allow-update { none; };
};
$ vi /etc/named.conf
$ vi /etc/named.rfc1912.zones
$ cd /var/named/
$ ls
$ sed -i 's/109/30/g' dev.ubaby.cn.zone #把109替换成30
$ sed -i 's/109/30/g' 192.168.1.in-addr.arpa.zone #把109替换成30
$ systemctl restart named
$ ll -Z
$ vi /etc/resolv.conf #添加要解析的地址
nameserver 192.168.1.30
$ systemctl stop firewalld #关闭防火墙
$ setenforce 0
$ systemctl restart named