标签:dns搭建
yum install -y bind
vim /etc/named.conf
zone "123.com" IN {
type master;
file "123.com.zone";
};
cat/var/named/named.localhost
named-checkconf
vim /var/named/123.com.zone
$TTL 1D
@ IN SOA @ admin.123.com. (
2015010909 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS ns.123.com.
IN MX 5 mail.123.com.
ns IN A 192.168.1.116
mail IN A 192.168.11.20
www IN A 11.11.11.11
bbs IN CNAME www
文件格式cat /var/named/named.localhost
# named-checkzone "123.com" /var/named/123.com.zone
[root@localhost ~]# vim /etc/named.conf
options {
listen-on port 53 { 127.0.0.1;192.168.1.116; };
[root@localhost ~]# named-checkzone "123.com" /var/named/123.com.zone
named-checkzone "123.com" /var/named/123.com.zone
/etc/init.d/named restart
dig @192.168.1.116 www.123.com
反向解析
vim /etc/named.conf
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.zone";
};
vim /var/named/1.168.192.zone
$TTL 1D
@ IN SOA @ admin.123.com. (
2015010909 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS ns.123.com.
20 IN PTR mail.123.com.
116 IN PTR ns.123.com.
[root@localhost ~]# named-checkconf
[root@localhost ~]# /etc/init.d/named restart
[root@localhost ~]# dig @192.168.1.116 -x 192.168.1.116
[root@localhost ~]# dig @192.168.1.116 -x 192.168.1.20
DNS主从
vim /etc/name.conf
zone "123.com" IN {
type slave;
file "slaves/123.com.zone";
masters { 192.168.1.116; };
};
zone "1.168.192.in-addr.arpa" IN {
type slave;
file "slaves/1.168.192.zone";
masters { 192.168.1.116; };
};
/etc/init.d/named restart
[root@localhost ~]# ls /var/named/slaves/
1.168.192.zone 123.com.zone
cat /var/named/slaves/123.com.zone
$ORIGIN .
$TTL 86400 ; 1 day
123.com IN SOA 123.com. admin.123.com. (
2015010909 ; serial
86400 ; refresh (1 day)
3600 ; retry (1 hour)
604800 ; expire (1 week)
10800 ; minimum (3 hours)
)
NS ns.123.com.
MX 5 mail.123.com.
$ORIGIN 123.com.
bbs CNAME www
mail A 192.168.11.20
ns A 192.168.1.116
www A 11.11.11.11
实时同步
要在主上
include "/etc/named.root.key";
zone "123.com" IN {
type master;
file "123.com.zone";
notify yes;
also-notify { 192.168.1.112; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.zone";
notify yes;
also-notify { 192.168.1.112; };
};
[root@localhost ~]# named-checkconf
[root@localhost ~]# /etc/init.d/named restart
标签:dns搭建
原文地址:http://10907714.blog.51cto.com/10897714/1730653