這篇文章主要介紹“怎么建立slave類型的DNS服務(wù)器”,在日常操作中,相信很多人在怎么建立slave類型的dns服務(wù)器問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”怎么建立slave類型的dns服務(wù)器”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!
我們提供的服務(wù)有:成都做網(wǎng)站、成都網(wǎng)站設(shè)計、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、牟定ssl等。為數(shù)千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的牟定網(wǎng)站制作公司
DNS服務(wù)器的類型:
Master: 提供dns服務(wù),并且本身含有區(qū)域文檔。
Slave: 和Master一起提供dns服務(wù),當(dāng)Master服務(wù)器上的名字地址對更改的時候,會自動更新Slave服務(wù)器來達(dá)到同步。
Cache-only: 沒有自己的區(qū)域文檔,只是幫助客戶段向外部dns請求查詢,然后將查到的結(jié)果保存到他的緩存中。
[@more@]
1,pre-configuration check
dig -t axfr example.com @192.168.0.254
host -l example.com 192.168.0.254
2,安裝包
yum install -y bind bind-utils bind-chroot caching-nameserver
3,編輯named.conf
zone "example.com" IN {
type slave;
masters { 192.168.0.254; };
file "slaves/example.com.zone";
forwarders {};
};
4, 修改文件權(quán)限
[root@station10 etc]# ls -lZ
-rw-r--r-- root root system_u:object_r:locale_t localtime
-rw-r----- root named system_u:object_r:named_conf_t named.caching-nameserver.conf
-rw-r----- root root root:object_r:named_conf_t named.conf
-rw-r----- root named system_u:object_r:named_conf_t named.rfc1912.zones
-rw-r--r-- root named system_u:object_r:dnssec_t rndc.key
[root@station10 etc]# chown root:named named.conf
[root@station10 etc]# chmod 640 !$
chmod 640 named.conf
[root@station10 etc]# ls -lZ
-rw-r--r-- root root system_u:object_r:locale_t localtime
-rw-r----- root named system_u:object_r:named_conf_t named.caching-nameserver.conf
-rw-r----- root named root:object_r:named_conf_t named.conf
-rw-r----- root named system_u:object_r:named_conf_t named.rfc1912.zones
-rw-r--r-- root named system_u:object_r:dnssec_t rndc.key
[root@station10 etc]#
5,啟動服務(wù)
[root@station10 etc]# service named configtest
zone localdomain/IN: loaded serial 42
zone localhost/IN: loaded serial 42
zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 1997022700
zone 255.in-addr.arpa/IN: loaded serial 42
zone 0.in-addr.arpa/IN: loaded serial 42
[root@station10 etc]# service named restart
6,查看產(chǎn)生的文件
[root@station10 etc]# cd /var/named/chroot/var/named/slaves/
[root@station10 slaves]# ls -lZ
-rw-r--r-- named named root:object_r:named_cache_t example.com.zone
[root@station10 slaves]# cat example.com.zone
7,測試
[root@station10 slaves]# host -r station10.example.com localhost
Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases:
station10.example.com has address 192.168.0.10
[root@station10 slaves]# dig +norecurse station10.example.com @localhost
; <<>> DiG 9.3.3rc2 <<>> +norecurse station10.example.com @localhost
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11983
;; flags: qr aa ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;station10.example.com. IN A
;; ANSWER SECTION:
station10.example.com. 86400 IN A 192.168.0.10
;; AUTHORITY SECTION:
example.com. 86400 IN NS server1.example.com.
;; ADDITIONAL SECTION:
server1.example.com. 86400 IN A 192.168.0.254
;; Query time: 14 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 10 00:55:54 2008
;; MSG SIZE rcvd: 93
[root@station10 slaves]#
到此,關(guān)于“怎么建立slave類型的dns服務(wù)器”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!