日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網(wǎng)為廣大站長(zhǎng)提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請(qǐng)做好本站友鏈:【 網(wǎng)站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會(huì)員:747

DNS(domain name server)簡(jiǎn)單的講就是域名解析服務(wù)器,是伯克利大學(xué)科研的成果,對(duì)于IP挑戰(zhàn)大家記憶力的時(shí)候,DNS無(wú)疑成了救命稻草,因?yàn)樗男瘦^之前使用的hosts和NIS有了質(zhì)的飛躍,想了解DNS的詳盡知識(shí),大家請(qǐng)去互聯(lián)網(wǎng)上去看啦!

實(shí)驗(yàn)平臺(tái):VM下兩臺(tái)linux centos5.5服務(wù)器,一臺(tái)作為主服務(wù)器(master),另一臺(tái)作為輔助服務(wù)器(slave)

IP規(guī)劃:

主服務(wù)器:192.168.1.193

輔服務(wù)器:192.168.1.195

第一:在主輔服務(wù)器上都要做的設(shè)置

首先就是是安裝DNS套件

[root@localhost ~]# yum -y install bind bind-chroot ypbind bind-utils caching-nameserver

第二:在主服務(wù)器上的設(shè)置(關(guān)鍵)

[root@localhost ~]# cd /var/named/chroot/etc///進(jìn)入主設(shè)置檔案所在的目錄
[root@localhost etc]# cp -p named.caching-nameserver.conf named.conf//制作主配置文件

以下這個(gè)步驟的含義是:每次服務(wù)啟動(dòng)時(shí)默認(rèn)的會(huì)去/etc目錄下去搜索配置文件,做這個(gè)軟連接也是這個(gè)原因。

[root@localhost etc]# ln -s /var/named/chroot/etc/named.conf /etc/named.conf

以下這個(gè)步驟是對(duì)rndc的設(shè)置(借助rndc對(duì)DNS服務(wù)器的管理,可以在不關(guān)閉DNS服務(wù)器的情況下,更新主服務(wù)器做過(guò)的修改)

[root@localhost ~]# rndc-confgen > /etc/rndc.conf//生成rndc的主配置文檔

對(duì)這個(gè)檔案不做任何的修改,只需把DNS需要的部分復(fù)制過(guò)去即可

[root@localhost ~]# vi /etc/rndc.conf
[root@localhost ~]# vi /etc/named.conf//修改主配置文件,主要修改以下列出的部分即可
listen-on port 53 { any; };
forwarders{202.102.240.65;};
allow-query{ any; };
allow-query-cache { any; };
match-clients{ any; };
match-destinations { any; };
###################### rndc-confgen###################
key "rndckey" {
algorithm hmac-md5;
secret "JkZ/MxIb8I58yefvWMkpIw==";
};

 
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndckey"; };
};
############################END ##################
以上這個(gè)步驟就是可以使用#rdnc reload重載配置文件
[root@localhost ~]# vi /etc/named.rfc1912.zones//添加自己的域
zone "ethnicity.com" IN {
type master;
file "named.ethnicity.com";
allow-update { none; };
allow-transfer { 192.168.1.195;};//這就是針對(duì)輔服務(wù)器做的設(shè)置
also-notify { 192.168.1.195; };
};

 

zone "1.168.192.in-addr.arpa" IN {
type master;
file "named.192.168.1";
allow-update { none; };
allow-transfer { 192.168.1.195;};
also-notify { 192.168.1.195; };
};
以下這個(gè)步驟是建立自己域名的配置文件
[root@localhost named]# cp -p localhost.zone named.ethnicity.com
[root@localhost named]# cp -p named.local named.192.168.1
[root@localhost named]# vi named.ethnicity.com//設(shè)置正解

 
$TTL86400
@IN SOAdns.ethnicity.com.root.ethnicity.com. (
46; serial (d. adams)
3H; refresh
15M; retry
1W; expiry
1D ); minimum

 

IN NSdns.ethnicity.com.
@IN MX 10mail.ethnicity.com.
www1IN A192.168.1.195
www2IN A192.168.1.196
www3IN A192.168.1.193
linuxIN CNAMEwww2
[root@localhost named]# vi named.192.168.1//設(shè)置反解

 

$TTL86400
@INSOAdns.ethnicity.com. root.ethnicity.com.(
1997022700 ; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400 ); Minimum
INNSdns.ethnicity.com.
195INPTRwww1.ethnicity.com.
196INPTRwww2.ethnicity.com.
193INPTRwww3.ethnicity.com.
[root@localhost ~]# vi /etc/resolv.conf
nameserver 192.168.1.193

然后是簡(jiǎn)單的測(cè)試

[root@localhost ~]# /etc/init.d/named restart
[root@localhost ~]# nslookup//以下測(cè)試可知正反解都可以成功
> 192.168.1.195
Server:192.168.1.193
Address:192.168.1.193#53

 

195.1.168.192.in-addr.arpaname = www1.ethnicity.com.
> www2.ethnicity.com
Server:192.168.1.193
Address:192.168.1.193#53

 
Name:www2.ethnicity.com
Address: 192.168.1.196
> exit

最后把配置文件同步到輔服務(wù)器上

[root@localhost ~]# scp /var/named/chroot/etc/named.conf 192.168.1.195:/var/named/chroot/etc/
[root@localhost~]#scp /var/named/chroot/etc/named.rfc1912.zones 192.168.1.195:/var/named/chroot/etc/

第二:在輔服務(wù)器上的設(shè)置

[root@localhost ~]# chgrp named /var/named/chroot/etc/named.conf
[root@localhost etc]# ln -s /var/named/chroot/etc/named.conf /etc/named.conf
[root@localhost ~]# vi /etc/named.conf
listen-on port 53 { any; };
forwarders{202.102.240.65;};
allow-query{ any; };
allow-query-cache { any; };
match-clients{ any; };
match-destinations { any; };
[root@localhost ~]# vi /etc/named.rfc1912.zones//添加以下的域
zone "ethnicity.com" IN {
type slave;
file "slaves/named.ethnicity.com";
masters { 192.168.1.193; };
};

 

zone "1.168.192.in-addr.arpa" IN {
type slave;
file "slaves/named.192.168.1";
masters { 192.168.1.193; };
};
[root@localhost ~]# /etc/init.d/named restart//重啟服務(wù)器就可以看到輔服務(wù)器的配置文件
[root@localhost ~]# ll /var/named/chroot/var/named/slaves/
total 16
-rw-rw-r-- 1 named named 398 Oct 25 07:06 named.192.168.1
-rw-r--r-- 1 named named 466 Oct 25 07:42 named.ethnicity.com

第三:測(cè)試的部分

這個(gè)步驟主要是觀察在主服務(wù)器修改配置文件是,通過(guò)#rndc reload時(shí),輔服務(wù)器數(shù)據(jù)的同步狀況。

[root@localhost named]# vi named.ethnicity.com//在主服務(wù)器域文件內(nèi)添加兩個(gè)CNAME。并且修改46; serial (d. adams)

 

 
$TTL86400
@IN SOAdns.ethnicity.com.root.ethnicity.com. (
46; serial (d. adams)
3H; refresh
15M; retry
1W; expiry
1D ); minimum

 

IN NSdns.ethnicity.com.
@IN MX 10mail.ethnicity.com.
www1IN A192.168.1.195
www2IN A192.168.1.196
www3IN A192.168.1.193
linuxIN CNAMEwww2
wanyanIN CNAMEwww3
ethnicityIN CNAMEwww1
[root@localhost named]# rndc reload
server reload successful

接著在輔服務(wù)器上查看變化,發(fā)現(xiàn)和主服務(wù)器是數(shù)據(jù)同步的。

[root@localhost ~]# cat /var/named/chroot/var/named/slaves/named.ethnicity.com
$ORIGIN .
$TTL 86400; 1 day
ethnicity.comIN SOAdns.ethnicity.com. root.ethnicity.com. (
46; serial
10800; refresh (3 hours)
900; retry (15 minutes)
604800; expire (1 week)
86400; minimum (1 day)
)
NSdns.ethnicity.com.
MX10 mail.ethnicity.com.
$ORIGIN ethnicity.com.
ethnicityCNAMEwww1
linuxCNAMEwww2
wanyanCNAMEwww3
www1A192.168.1.195
www2A192.168.1.196
www3A192.168.1.193

 

LINUX下構(gòu)建DNS的基本主輔框架

 

分享到:
標(biāo)簽:DNS
用戶無(wú)頭像

網(wǎng)友整理

注冊(cè)時(shí)間:

網(wǎng)站:5 個(gè)   小程序:0 個(gè)  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會(huì)員

趕快注冊(cè)賬號(hào),推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過(guò)答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫(kù),初中,高中,大學(xué)四六

運(yùn)動(dòng)步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動(dòng)步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績(jī)?cè)u(píng)定2018-06-03

通用課目體育訓(xùn)練成績(jī)?cè)u(píng)定