標籤:記錄 record 膠水
DNS 配置篇二
一、子網域設定
1、基本概念
子域的作用是在本地DNS下再劃分一個小的(子)DNS。作用的方便集中管理,
不過問題是要配置轉寄。父DNS可以知道解析子DNS,子DNS 則只可以解析自己
本地記錄,不能解析父DNS。
正向子域授權:
只需要在父域的地區解析庫中添加“膠水記錄”, glue record
子網域名稱稱 IN NS 子域的名稱伺服器
ops IN NS ns.ops
ops IN NS ns2.ops
ns.ops IN A 172.16.100.77
ns2.ops IN A 172.16.100.78
dev IN NS ns.dev
ns.dev IN A 172.16.100.88
二、實驗
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-30427" border="0" alt="wps_clip_image-30427" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429129Bfk0.png" height="325" />
(實驗)
1、Ops /etc/named.conf 不再講解,不瞭解可以看DNS配置篇一
2、Ops /etc/named.rfc1912.zones圖
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-25980" border="0" alt="wps_clip_image-25980" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429150agJk.png" height="221" />
設定轉寄
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-13043" border="0" alt="wps_clip_image-13043" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429190w46K.png" height="248" />
3、master /var/named/dingchao.com.zone
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-24239" border="0" alt="wps_clip_image-24239" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429211eyI6.png" height="233" />
4、ops /var/named/ops.dingchao.com.zone
650) this.width=650;" title="wps_clip_image-16007" alt="wps_clip_image-16007" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429229vvXV.png" height="235" />
5、實驗結果
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-22408" border="0" alt="wps_clip_image-22408" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429271FJIR.png" height="315" />
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-32215" border="0" alt="wps_clip_image-32215" src="http://img1.51cto.com/attachment/201408/7/8400375_14074293172UEv.png" height="322" />
650) this.width=650;" title="wps_clip_image-9765" alt="wps_clip_image-9765" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429363YAvX.png" height="324" />
三、ACL 設定
內建的ACL:
none, any, local(本機), localnet(本機所在網路)
自訂acl:
acl ACL_NAME {
ip;
ip;
network;
};
acl localnetwork {
172.16.0.0/16;
192.168.0.0/24;
};
allow-recursion { localnetwork; };
650) this.width=650;" title="wps_clip_image-19964" alt="wps_clip_image-19964" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429400nm2y.png" height="278" />
四、DNS的視圖
DNS 視圖的作用就是根據用戶端請求IP地址的解析,返回給用戶端一個既定的IP
的地址。簡單點說就是客戶請求判斷是否為自己定義的IP位址區段,然後解析返回給
用戶端自己定義的IP地址。
具體應用:中國電信、聯通不同網路,給以定義,電信使用者只解析電信IP 位址,
聯動的話則轉給聯通伺服器讓其自己解析。屬於智能DNS解析。
根據用戶端來源的不同,將同一個名稱解析至不同的值;
dnspod、dns.la
acl telecom {
};
acl unicom {
};
view VIEW_NAME {
match-clients { telecom; };
zone "mageedu.com" IN {
type master;
file "mageedu.com.tel";
};
};
view VIEW_NAME {
match-clients { unicom; };
zone "mageedu.com" IN {
type master;
file "mageedu.com.uni";
};
};
view VIEW_NAME {
};
使用view注意的事項:
1、通常只為內網用戶端提供遞迴功能,提供根地區等;
2、通過只為外網用戶端提供本機所負責的地區的解析;
1、/etc/named.conf 不再講解,不瞭解可以看DNS配置篇一
2、 /etc/named.rfc1912.zones 第一給DNS視圖配置
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-23777" border="0" alt="wps_clip_image-23777" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429413YRMz.png" height="304" />
3、 /etc/named.rfc1912.zones 第二給DNS視圖配置
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-8936" border="0" alt="wps_clip_image-8936" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429435T8Na.png" height="339" />
4、 /var/named/dingchao.com.int 配置
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-9952" border="0" alt="wps_clip_image-9952" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429448Mb80.png" height="328" />
5、/var/named/dingchao.com.ext配置
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-20029" border="0" alt="wps_clip_image-20029" src="http://img1.51cto.com/attachment/201408/7/8400375_140742947175GY.png" height="307" />
6、許可權修改
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-24074" border="0" alt="wps_clip_image-24074" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429500FGZB.png" height="271" />
7、實驗結果本機內解析
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-32232" border="0" alt="wps_clip_image-32232" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429514e9kT.png" height="314" />
8、實驗結果本機外的地址
650) this.width=650;" style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" title="wps_clip_image-19885" border="0" alt="wps_clip_image-19885" src="http://img1.51cto.com/attachment/201408/7/8400375_1407429539C6RY.png" height="311" />