新聞中心
DNS是計(jì)算機(jī)域名(Domain Name System)的縮寫(xiě),它是由解析器和域名服務(wù)器組成的。域名服務(wù)器是指保存有該網(wǎng)絡(luò)中所有主機(jī)的域名和對(duì)應(yīng)IP地址,并具有將域名轉(zhuǎn)換為IP地址功能的服務(wù)器,下面為大家分享一下Ubuntu下配置DNS服務(wù)器具體步驟。

讓客戶(hù)滿(mǎn)意是我們工作的目標(biāo),不斷超越客戶(hù)的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶(hù),將通過(guò)不懈努力成為客戶(hù)在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:域名申請(qǐng)、網(wǎng)站空間、營(yíng)銷(xiāo)軟件、網(wǎng)站建設(shè)、元寶山網(wǎng)站維護(hù)、網(wǎng)站推廣。
環(huán)境說(shuō)明
服務(wù)器IP 10.68.19.61
操作系統(tǒng) Ubuntu 13.04
DNS程序 Bind9
測(cè)試域名 mycloud.com
目標(biāo)IP 10.68.19.134
安裝配置BIND9
apt-get install bind9
總共需要編輯2個(gè)文件,新增2個(gè)文件,如下: 修改/etc/bind/named.conf.options,去掉forwarders的注釋?zhuān)渲械腎P為網(wǎng)絡(luò)營(yíng)運(yùn)商提供的DNS服務(wù)器,這里我們使用google的DNS。
forwarders {
8.8.8.8;
8.8.4.4;
};
修改/etc/bind/named.conf.local,在最后增加增加雙向解析代碼:
zone "mycloud.com" {
type master;
file "/etc/bind/db.mycloud.com";
};
zone "19.68.10.in-addr.arpa" {
type master;
file "/etc/bind/db.10.68.19";
};
注意:其中的19.68.10是目標(biāo)IP10.68.19.134的前三段,表示一個(gè)IP地址段。
新增域名(mycloud.com)解析文件/etc/bind/db.mycloud.com,內(nèi)容如下:
;
; BIND data file for dev sites
;
$TTL 604800
@ IN SOA mycloud.com. root.mycloud.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS mycloud.com.
@ IN A 10.68.19.134
*.mycloud.com. 14400 IN A 10.68.19.134
新增IP地址反向解析文件/etc/bind/db.10.68.19,內(nèi)容如下:
;
; BIND reverse data file for dev domains
;
$TTL 604800
@ IN SOA dev. root.dev. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS mycloud.com.
134 IN PTR mycloud.com.
重啟BIND9服務(wù)
service bind9 restart
修改本機(jī)配置
修改每一臺(tái)需要使用該DNS服務(wù)器的dns配置文件
sudo vi /etc/resolv.conf
修改nameserver為上邊配置好的DNS服務(wù)器IP
nameserver 10.68.19.61
此修改在每次重啟服務(wù)器后都會(huì)賠覆蓋,可以修改配置文件
sudo vi /etc/resolvconf/resolv.conf.d/base
在其中增加一條
nameserver 10.68.19.61
這樣重啟服務(wù)器后DNS配置依然有效,然后重啟networking服務(wù),刷新DNS緩存。
service networking restart
測(cè)試效果
root@controller:/etc/bind# nslookup
> baidu.com
Server: 10.68.19.61
Address: 10.68.19.61#53
Non-authoritative answer:
Name: baidu.com
Address: 220.181.111.86
Name: baidu.com
Address: 123.125.114.144
Name: baidu.com
Address: 220.181.111.85
> mycloud.com
Server: 10.68.19.61
Address: 10.68.19.61#53
Name: mycloud.com
Address: 10.68.19.134
> uaa.mycloud.com
Server: 10.68.19.61
Address: 10.68.19.61#53
Name: uaa.mycloud.com
Address: 10.68.19.134
解析情況為,域名:baidu.com,在本地DNS中沒(méi)有找到匹配,通過(guò)DNS:8.8.8.8解析,mycloud.com在本地DNS中有匹配,解析到10.68.19.134.
網(wǎng)站標(biāo)題:Ubuntu下配置DNS服務(wù)器具體步驟
本文來(lái)源:http://fisionsoft.com.cn/article/cdeeppe.html


咨詢(xún)
建站咨詢(xún)
