泛域名解析:当用户输错站点后自动弹出一个指定的页面,
在正向域里设置:
$TTL 600
@ IN SOA ns1.mylinux.com. admin.mylinux.com. (
20160708
1H
5M
2D
6H
)
IN NS ns1
IN MX 9 mail.mylinux.com.
ns1 IN A 192.168.1.1
www IN A 192.168.1.1
www IN A 192.168.1.3
ftp IN CNAME www.mylinux.com.
mail IN A 192.168.1.2
mylinux.com. IN A 192.168.1.99
*.mylinux.com. IN A 192.168.1.99
--------------------------------------------------------------------
[root@localhost ~]# vim /etc/named.conf
options {
directory "/var/named";
recursion yes; 是否递归|| allow-recursion {192.168.1.0/16;};指定给哪个网段的用户递归。
#allow-query {只允许谁来查询;};
#allow-transfer {只允许谁来传送;};
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "named.localhost";
#allow-transfer {none;谁都不让传送};
};
zone "mylinux.com" IN {
type master;
file "mylinux.com.zone";
#allow-transfer {192.168.1.1;只允许1.1来传送};
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.zone";
};
[root@localhost ~]# dig +norecurse -t A 163.com @192.168.1.50 不递归查找
[root@localhost ~]# dig +trace -t A www.baidu.com @192.168.1.50 解析跟踪
axfr:完全区域传送
[root@localhost ~]# dig -t axfr mylinux.com
ixfr:增量区域传送
[root@localhost ~]# dig -t ixfr mylinux.com
dig -t IXFR=2016070802 mylinux.com 指定版本做增量区域传送
从服务器配置
mv/etc/named.conf /etc/named.conf.orig
scp 192.168.1.50:/etc/named.conf /etc/
vim named.conf
options {
directory "/var/named";
allow-recursion {192.168.1.0/16;};
notify yes; 启动通知功能
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "named.localhost";
allow-transfer {none;};
};
zone "mylinux.com" IN {
type slave; 设置类型为从服务器
file "slaves/mylinux.com.zone";文件保存位置
masters {192.168.1.1;}; 指定主服务器的IP
allow-transfer {none;};不允许别的服务器来传送
};
zone "1.168.192.in-addr.arpa" IN {
type slave;
masters {192.168.1.1;};
file "slaves/1.168.192.zone";
allow-transfer {none;};
};
需要在主服务器上定义从服务器为dns服务器
正向添加一条
vi/var/named/mylinux.com.zone
IN NS ns2
ns2 IN A 192.168.1.1
反向添加:
IN NS ns2.mylinux.com.
2 IN PTR ns2.mylinux.com.
本文出自 “linux运维” 博客,谢绝转载!
原文地址:http://coolcl.blog.51cto.com/4514424/1812712