?? dns-howto.txt
字號:
這會產(chǎn)生 named.conf: _________________________________________________________________ // generated by named-bootconf.ploptions { directory "/var/named";};zone "." { type hint; file "root.hint";};zone "0.0.127.IN-ADDR.ARPA" { type master; file "127.0.0.zone";};zone "localhost" { type master; file "localhost.zone";}; _________________________________________________________________ 它將 named.boot 中的每樣?xùn)|西都轉(zhuǎn)換過來,然而它并未加入所有 bind 8 所允 許的新強化及配置選項. 這里有份較完整的 named.conf 做同樣的事,但是效率 更好一點. _________________________________________________________________ // This is a configuration file for named (from BIND 8.1 or later).// It would normally be installed as /etc/named.conf.// The only change made from the `stock' named.conf (aside from this// comment :) is that the directory line was uncommented, since I// already had the zone files in /var/named.options { directory "/var/named"; check-names master warn; /* default. */ datasize 20M;};zone "localhost" IN { type master; file "localhost.zone"; check-names fail; allow-update { none; }; allow-transfer { any; };};zone "0.0.127.in-addr.arpa" IN { type master; file "127.0.0.zone"; check-names fail; allow-update { none; }; allow-transfer { any; };};zone "." IN { type hint; file "root.hint";}; _________________________________________________________________ bind8/src/bin/named/test 里有這個□例,以及領(lǐng)域檔案的拷貝,許多人可以直 接拿來修改使用. 領(lǐng)域檔案及 root.hint (root.cache) 完全相同,更新它們的指令也是. 8. 撥接連線的自動設(shè)定 這一節(jié)解釋我如何設(shè)定以便讓每個過程自動化. 我的方法可能一點都不適合你, 但是你可能從我所作的一些事情里得到一些點子. 同時,我使用 PPP 撥接,然 而有許多人使用 slip 或是 cslip 連線方式, 所以你的設(shè)定里幾乎每個地方都 可能跟我的不同. 但是 slip 使用的 dip 程式應(yīng)該能夠完成我所作的許多事情 . 一般來說,當(dāng)我沒有連上網(wǎng)路時我的 resolv.conf 檔案單純地包含這一行 domain uio.no 這確保我不必等待主機名稱解析函式庫去嘗試聯(lián)系某臺不可能幫助我的名稱伺服 器. 但是當(dāng)我連上線的時候我想要起始我的 named 并且擁有一個看起來像前面 所描述的 resolv.conf 檔案. 我藉由保持兩份 resolv.conf 的‘樣板’檔案 ,resolv.conf.local 以及 resolv.conf.connected 來解決問題. 後面這一個 看起來像前面所描述過的 resolv.conf 檔案. 要自動化連線到網(wǎng)路的過程我執(zhí)行一個稱為 `ppp-on' 的指令稿: _________________________________________________________________ #!/bin/shecho calling...pppd _________________________________________________________________ pppd 有個稱為 options 的檔案,它告訴 pppd 如何取得連線的一些特殊事項. 一旦我的 ppp 連線完成後 pppd 起始一個稱為 ip-up 的指令(這在 pppd 的線上 使用手冊里有描述). 這里是該指令稿里面的一部份: _________________________________________________________________ #!/bin/shinterface="$1"device="$2"speed="$3"myip="$4"upip="$5" ...cp -v /etc/resolv.conf.connected /etc/resolv.conf .../usr/sbin/named _________________________________________________________________ 換句話說,我在這里起始我的 named 程式.當(dāng) ppp 離線時 pppd 執(zhí)行一個稱為 ip-down 的指令稿: _________________________________________________________________ #!/bin/shcp /etc/resolv.conf.local /etc/resolv.confread namedpid < /var/run/named.pidkill $namedpid _________________________________________________________________ 所以這在連線時配置并設(shè)定相關(guān)事宜并且在離線時解除該配置并結(jié)束相關(guān)程式. 某些程式,例如我想起 irc 與 talk,做了過多的假定,為了讓其工作正常你必 須修改你的 hosts 檔案. 我在 ip-up 上加入 _________________________________________________________________ cp /etc/hosts.ppp /etc/hostsecho $myip roke >>/etc/hosts _________________________________________________________________ hosts.ppp 是簡單地包含了 _________________________________________________________________ 127.0.0.1 localhost _________________________________________________________________ 而 echo 指令插入了我收到的 IP 號碼做為我機器的名稱(roke). 你應(yīng)該改用你 自己機器的名稱,可以用 hostname 指令查出. 當(dāng)你沒有連線到網(wǎng)路上時執(zhí)行 named 可能并不聰明, 這是因為 named 將會嘗試 送出查詢到網(wǎng)路上而且其終止時限(timeout)很長, 而每次有某些個程式嘗試解 析一個名稱的時候你就得等待到這個終止時限. 如果你使用撥接的話你應(yīng)該在連 上網(wǎng)時起始 named 并且在離線時殺掉它. 不過請參考 [15]FAQ 一節(jié)的提示. 某些人喜歡在慢速的連線上使用 forwarders 指令. 如果你的網(wǎng)際網(wǎng)路提供者在 1.2.3.4 以及 1.2.3.5 設(shè)有 DNS 伺服器那麼你可以插入這麼一行 _________________________________________________________________ forwarders 1.2.3.4 1.2.3.5 _________________________________________________________________ 到 named.boot 檔案里去. 這將會減低源自你主機的 IP 流量,可能稍微提升速 度.如果你是依線路的資料量付費的話這點特別重要. 這還有個附加價值,讓你 脫離作為一個暫存的 named 維護者所應(yīng)負(fù)起的責(zé)任: 你不需要去更新一個空的 root.cache 檔案. 9. 常見問題解答 本節(jié)中我將列出一些關(guān)於 DNS 以及本文件最常被提出的問題.還有解答 :-) 在 寫信給我前請先閱讀過本節(jié). 1. 如何在防火墻之內(nèi)使用 DNS ? 一些提示: `forwarders', `slave', 以及參考本文件最後面的文獻(xiàn)列表. 2. 如何利用 DNS 提供的可用位址於某一服務(wù),如 www.busy.site, 以獲得負(fù) 荷平衡或類似的效果? 為 www.busy.site 加上許多 A 記錄,而且使用 bind 4.9.3 或以後的版本 . 這樣 bind 會使用 round-robin 演算法找尋答案.這不能在更早版本的 bind 上工作. 3. 我想在一封閉的 Intranet 上架設(shè) DNS.我該怎麼做? 把暫存檔案丟掉只留區(qū)域檔案.這也表示你將不需要更新暫存檔案. 4. 我的系統(tǒng)沒有 ndc 程式.我該怎麼辦? 你的系統(tǒng)安裝過一舊的,可能過期的 bind 程式. 如果安全性對你很重要: 立刻將 bind 升級.如果不是,你也可以用這舊的. 你可直接執(zhí)行 named 而不是 ndc start. ndc reload 變成 named.reload 而 ndc restart 變成 named.restart. 所有這些程式可能都在 /usr/sbin 里. 5. 如何建立次要名稱伺服器? 如果主要名稱伺服器的地址是 127.0.0.1, 在你的次要名稱伺服器的 named.boot 檔案中放一行: _____________________________________________________________ secondary linux.bogus 127.0.0.1 sz/linux.bogus _____________________________________________________________ 6. 我希望離線時 bind 仍繼續(xù)執(zhí)行. 我收到來自 Ian Clark < [16]ic@deakin.edu.au> 的信件解釋他如何辦到這 點. I run named on my 'Masquerading' machine here. I havetwo root.cache files, one called root.cache.real which containsthe real root server names and the other called root.cache.fakewhich contains...--------------; root.cache.fake; this file contains no information--------------When I go off line I copy the root.cache.fake file to root.cache andrestart named.When I go online I copy root.cache.real to root.cache and restartnamed.This is done from ip-down & ip-up respectively.The first time I do a query off line on a domain name named doesn'thave details for it puts an entry like this in messages..Jan 28 20:10:11 hazchem named[10147]: No root nameserver for class INwhich I can live with.It certainly seems to work for me. I can use the nameserver forlocal machines while off the 'net without the timeout delay forexternal domain names and I while on the 'net queries for externaldomains work normally 7. 名稱伺服器將暫存資料保存在那兒? 有任何方法可以控制它的大小嗎? 所有的暫存資料都保存在記憶體中,任何時刻它都不會被寫入磁碟中. 每次 你殺掉 named 時這些暫存資料就沒有了.沒有任何方法可以控制暫存資料. named 用一些簡單的法則來管理它.你不能用任何理由任何方法控制暫存資 料或其大?。?如果你希望如此你可以自己去改 named 的程式.不過最好別 這麼做. 8. 如何在重新起始 named 之間保存暫存資料? 我可以把它存下來嗎? 不! named 被殺掉時不會保留暫存資料. 這就是說暫存資料必須在每次你殺 掉并重新起始 named 後重新建立. 沒有辦法讓 named 將暫存資料存到檔案 里. 如果你希望如此你可以自己去改 named 的程式.不過最好別這麼做. 10. 如何成為一個大型的 DNS 管理者 文件以及工具 存在真正的文件.在線上的或是印好的.要跨出由小型 DNS 到大型 DNS 管理者 的一步閱讀幾份這些文件是必要的. 印好的標(biāo)準(zhǔn)參考書是 DNS and BIND by C. Liu and P. Albitz from O'Reilly & Associates, Sebastopol, CA, ISBN 0-937175-82-X. 我讀過,它很棒.在另一本 TCP/IP Network Administration, by Craig Hunt from O'Reilly..., ISBN 0-937175-82-X 有一 節(jié)是關(guān)於 DNS 的.另一本對管理 DNS 很好的(或者是對任何這一類工作都很好) 書則是 Zen and the Art of Motorcycle Maintenance, 作者 Robert M. Prisig 書號 ISBN 0688052304. 線上的資料你可以在這里找到 [17]http://www.dns.net/dnsrd/, [18]http://www.isc.org/bind.html; 常見問題集,參考手冊(BOG; Bind Operations Guide)是協(xié)定的定義以及 DNS 研究的文獻(xiàn). 這些文件我大部分沒有 閱讀過,但是因此我不是個大型 DNS 管理者. 另一方面 Arnt Gulbrandsen 已 經(jīng)讀過 BOG 而且對此很熟稔 :-). 網(wǎng)路新聞討論群 [19]comp.protocols.tcp-ip.domains 是有關(guān) DNS 的討論群. 此外還有好幾份 關(guān)於 DNS 的 RFCs,最重要的可能是這些: RFC 2052 A. Gulbrandsen, P. Vixie, A DNS RR for specifying the location of services (DNS SRV), October 1996 RFC 1918 Y. Rekhter, R. Moskowitz, D. Karrenberg, G. de Groot, E. Lear, Address Allocation for Private Internets, 02/29/1996. RFC 1912 D. Barr, Common DNS Operational and Configuration Errors, 02/28/1996. RFC 1713 A. Romao, Tools for DNS debugging, 11/03/1994. RFC 1712 C. Farrell, M. Schulze, S. Pleitner, D. Baldoni, DNS Encoding of Geographical Location, 11/01/1994. RFC 1183 R. Ullmann, P. Mockapetris, L. Mamakos, C. Everhart, New DNS RR Definitions, 10/08/1990. RFC 1035 P. Mockapetris, Domain names - implementation and specification, 11/01/1987. RFC 1034 P. Mockapetris, Domain names - concepts and facilities, 11/01/1987. RFC 1033 M. Lottor, Domain administrators operations guide, 11/0
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -