SOA:
序列号、刷新时间、重试时间、过期时间、否定回答的TTL
H 、D、M、W
BIND:
RR类型:A,PTR,NS,MX,CNAME,SOA,AAAA
语法:
name [TTL] IN rr_type value
DNS an BIND(2)
子域授权:每个域的名称服务器,都是通过其上级名称服务器在解析库中进行授权;
类似根域授权tld:
.com IN NS ns1.com.
.com IN NS ns2.com.
ns1.com. IN A 2.2.2.1
ns2.com. IN A 2.2.2.2
magedu.com. 在.com的名称服务器上,解析库中添加资源记录;
magedu.com. IN NS ns1.magedu.com.
magedu.com. IN NS ns2.magedu.com.
magedu.com. IN NS ns3.magedu.com.
ns1.magedu.com. IN A 3.3.3.1
ns2.magedu.com. IN A 3.3.3.2
ns3.magedu.com. IN A 3.3.3.3
BIND的安装配置:
dns服务,程序包名bind,程序名named
dnssec:
建议测试时关闭dnssec;
主DNS服务器:
1.在主配置文件中定义区域
zone “ZONE_NAME” IN {
type {master|slave|hint|forward};
file "ZONE_NAME.zone"
};
2.定义区域解析库文件
出现的内容:
宏定义;
资源记录;
例如:
$TTL 86400
$ORIGIN magedu.com. (如果没有默认也是域名magedu.com.)
@ IN SOA ns1.magedu.com. admin.magedu.com (
2015042201
1H
5M
7D
1D )
IN NS ns1(ns1.magedu.com.(ORIGIN或是默认域名))
IN NS ns2
IN MX 10 mx1
IN MX 20 mx2
ns1 IN A 172.16.100.11
ns2 IN A 172.16.100.12
mx1 IN A 172.16.100.13
mx2 IN A 172.16.100.14
www IN A 172.16.100.11
ftp IN CNAME ns1
测试命令:dig的使用
dig [-t type] name [@Server]
dig用于测试dns系统,因此不会查询hosts文件进行解析
查询选项:
+[no] trace:跟踪解析过程
+[no] recurse:进行递归解析
******************************************************************************************
yum -y install bind
rpm -ql bind
rpm -qi bind
yum list all bind*
ss -tunlp |grep :53
cp /etc/named.conf{,.bak} #备份文件
named-checkconf #检查主配置文件
named-checkzone "magedu.com" /var/named/magedu.com.zone
chown :named magedu.com.zone
chmod 640 magedu.com.zone
rndc status
dig -t A www.magedu.com @172.16.100.11
service named restart(reload)
rndc reload
/etc/resolv.conf
******************************************************************************************