DNS(Domain Name System域名系统)区域化管理
分布式
层次性
域名空间结构
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679818U0rX.jpg)
1.根域(root)
2.顶级域
组织域
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679818dIlO.jpg)
国家或地区域
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346798187UVU.jpg)
3.二级域
4.主机名
FQDN(full qualified domain name 完全合格域名)=主机名+DNS后缀名 如: www为主机名 liuqiang.com为DNS后缀名
DNS的查询方式
从查询方式分类
递归查询
客户端得到结果只能是成功或失败
迭代查询
DNS服务器如有客户机请求数据则返回正确地址
DNS服务器没有请求数据则返回一个指针,按指针继续查询
比如:
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346798197bO8.jpg)
从查询内容分类
正向查询:由域名查找IP地址
反向查询:由IP地址查找域名
域名解析顺序
本地DNS缓存---------本地host文件---------DNS服务器
开始
一、安装DNS服务器角色
1.设置静态ip地址
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679819oO2J.jpg)
2.打开服务器管理器,添加角色
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679819bM23.jpg)
3.选择DNS服务器
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346798212efp.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679821IrP6.jpg)
4.安装
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679966mvVm.jpg)
5.打开DNS管理控制台,选择“正向查找区域”,选择“新建区域”
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679967eyvy.jpg)
6.创建主要区域
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679967axjI.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679967RV1R.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679968n7qN.jpg)
7.区域的名称
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346799681ChZ.jpg)
8.创建区域文件
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346799696Rdl.jpg)
9.动态更新
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434679969owVN.jpg)
10.完成
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346800876j1m.jpg)
11.创建主机记录,由域名解IP的正向解析的主机记录
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680087gc4G.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680088Yy4h.jpg)
12.创建别名记录
![](http://blog.chinaunix.net/attachment/201506/19/29698941_143468008869n1.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680089wNXJ.jpg)
13.创建反向查找区域
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680089vX5J.jpg)
14.创建主要区域
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680090Xcux.jpg)
15.选择“IPv4反向查找区域”
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346800904fNn.jpg)
16.输入网络ID
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680531NPRX.jpg)
17.创建区域文件
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680531oJ99.jpg)
18.动态更新
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680532G1bd.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680532OstZ.jpg)
19.为反向查找区域创建反向PTR指针记录(ip解域名)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680534idJ8.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680534MO63.jpg)
20.使用DNS客户机来验证各种资源记录:
域名解ip 成功
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680535DMkm.jpg)
Ip解域名 成功
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680534Kh3Y.jpg)
二、子域
1.在区域中可以创建子域来管理资源记录
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680669evZQ.jpg)
2.比如在liuqiang.com中创建子域sh.liuqiang.com管理上海分公司
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680669YzMc.jpg)
父域下的子域
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346806709s2B.jpg)
三、DNS委派
区域中的子域过多时,维护起来不方便,域名查询量的瓶颈,新建委派可以将子域委派到其他服务器维护。
例如:区域liuqiang.com在服务器1.1.1.1上,要将子域bj.liuqiang.com委派到服务器1.1.1.2上
1.在服务器1.1.1.1上新建主机记录,例如:dns2.liuqiang.com ip:1.1.1.2
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680670Ht5p.jpg)
2.在1.1.1.1上新建委派
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680671zbqq.png)
3.在受委派域名中输入“bj”
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680671427U.jpg)
4.在名称服务器中,添加服务器完全合格的域名。
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346806718oEG.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434680672x62h.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681134BFb8.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346811349A51.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681134G5Pk.jpg)
5.在1.1.1.2服务器上新建主要区域
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681135Q35j.jpg)
6.区域名称为bj.liuqiang.com
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681136ig2d.jpg)
7.区域文件
![](http://blog.chinaunix.net/attachment/201506/19/29698941_143468113688yX.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346811365f4r.jpg)
8.完成委派区域后,就可以在被委派的区域bj.liuqiang.com中新建各种资源记录了
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681137PSjw.jpg)
四、区域传送
将一个区域文件复制到多个DNS服务器的过程,从主服务器上将区域文件复制到辅助服务器,减轻单台DNS服务器负载
从主服务器上将区域文件复制到辅助服务器。
实验:将主服务器1.1.1.1区域文件复制到辅助服务器1.1.1.10上
1.首先右键点击服务器1.1.1.1区域liuqiang.com,选择“属性”
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681602It4H.jpg)
2.选择“区域传送”,“只允许下列服务器”
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346816034za6.jpg)
3.在辅助服务器1.1.1.10上新建辅助区域
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681603ottS.jpg)
4.同样输入区域名 liuqiang.com
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681604Ee7u.jpg)
5.在主DNS服务器中输入IP地址 “1.1.1.1”
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681604P6NT.jpg)
6.完成辅助区域的创建,全都已复制过来了
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346816044Up6.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434681605M2UT.jpg)
五、DNS转发器
![](http://blog.chinaunix.net/attachment/201506/19/29698941_14346816052qzg.jpg)
假如有两棵域树,benet.com和accp.com,都有自己的DNS服务器,分别为192.168.1.1和192.168.1.2,如果双方的用户都想访问对方中的资源。所以要分别在benet.com和accp.com的DNS服务器来配置转发器功能
配置转发器:把两个DNS服务器设置转发器各自指向对方的IP地址
1.首先在benet.comDNS服务器上做向accp.comDNS服务器条件转发器
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434682185NoO2.jpg)
2.然后在accp.comDNS服务器上做向benet.comDNS服务器条件转发器
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434682188ff2g.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434682188nZnQ.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434682186b1Uv.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434682187eifG.jpg)
![](http://blog.chinaunix.net/attachment/201506/19/29698941_1434682187Rsk5.jpg)
试验成功