DNS服務的搭建

來源:互聯網
上載者:User

標籤:設定檔   查詢方式   justify   主機   style   

  1. DNS的相關設定檔

    /etc/hosts 本地主機列表

    /etc/nssswitch.conf 本地主機查詢方式

    /etc/host.conf

    /etc/resolv.conf 用戶端DNS查詢

    Bind和bind-chroot 為DNS的軟體包

    DNS的主目錄在/var/named/chroot

    /var/named/chroot/etc/named.conf DNS的全域安全設定檔

/ /name.rfc1912.zones 記錄DNS正向及反向解析的設定檔

二.開始實驗

首先進入/etc/hosts中將ip地址和網域名稱寫下來

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/55/69/wKiom1SJhFaDIDYkAAB4Nca4Inw419.jpg" />

然後驗證,發現可以看到iP地址

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/55/67/wKioL1SJhO6ydgY7AAFaciNcQsE388.jpg" />

然後用yum安裝bind和bind-chroot這兩個包,這是dns的安裝包

然後service named restart 就可以生效,

緊接著chkconfig named on 就可以重啟生效了

然後就可以在/var下面看到named的檔案夾了

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/55/69/wKiom1SJhFbC9RNQAAAt3T8t-sM973.jpg" />

進入/var/named/chroot/etc下就可以看到named.conf這個設定檔了

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/55/67/wKioL1SJhO6Tt6vpAABv-pHbfdU235.jpg" />

進入其中就可以了

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/55/69/wKiom1SJhFahIfttAADV6mkVHZI262.jpg" />

然後進入named.rfc1912.zones中,進行網域名稱的正向和反向解析配置

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/55/67/wKioL1SJhO7DGWPXAAB-1DWyGlU767.jpg" />

然後進入到/var/named/chroot/var/named中可以看到named.localhost和named.empty這兩個檔案

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/55/69/wKiom1SJhFbjFm_vAAB9KzcdfXY586.jpg" />

接下來要做的就是建立檔案example.zone和zone.example這兩個檔案,然後將named.localhost和named.empty的內容copy到其中,值得注意的是,所有組必須為named

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/55/67/wKioL1SJhO7TDHE2AAEzL9Z0sR0896.jpg" />

然後就進入正向網域名稱檔案example.zone和反向網域名稱檔案zone.example中了,將其修改為如下即可

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/55/69/wKiom1SJhFqCBMFfAABlNNYmgYw363.jpg" />

然後重啟服務

最後就用nslookup解析,通過可知,實驗成功!!!

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/55/67/wKioL1SJhPKT4IrnAABjYOaTZS0884.jpg" />

實驗至此結束!!!

DNS服務的搭建

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.