<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[鍵盤語言 (Keyboard Languag)]]></title> 
<link>http://www.xspace.idv.tw/bo_blog/index.php</link> 
<description><![CDATA[網路語言是時代變遷的記錄，更是社會文化的載體，它彰顯出網路時代青年人的思維習慣與言語方式，是當代青年人以網路生活為主題，尤其在網聊、「網路社區」中使用的「鍵盤語言」。沒有規則，自成方圓的網路語言以其快捷性、豐富性、自由性、互通性的鮮明特徵，迅速地成為了虛擬時代青少年的新寵。當然,這些網路「新語言」撇開了語言規範，只能用在網路世界中，現實生活裏，我們還得「老老實實」說話。]]></description> 
<language>zh-tw</language> 
<copyright><![CDATA[鍵盤語言 (Keyboard Languag)]]></copyright>
<item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?137</link>
<title><![CDATA[啟動 Nslookup.exe 時找不到伺服器名稱]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Thu, 07 Jun 2007 14:44:42 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?137</guid> 
<description>
<![CDATA[ 
	當自己架設好的DNS伺服器，而在 Windows 網路設定也指定使用該DNS當預設的DNS伺服器時<br /><br />假設該台DNS伺服器IP為： 192.168.1.254<br /><br />而在 Windows 系統下使用 nslookup.exe 查詢時卻出現：<span style="color: #990000"><strong>*** Can't find server name for address 192.168.1.254: Non-existent domain</strong></span> 這個訊息<br /><br />此訊息依據 微軟官方的說明為：<span style="color: #990000"><strong>(*** 找不到位址 192.168.1.254 的伺服器名稱：不存在的網域)<br /><br /></strong><span style="color: #000000">而會造成此問題的原因為：<strong><span style="color: #990000">當名稱伺服器的 IP 位址沒有 PTR 記錄時，可能就會發生這個錯誤。 <span style="background-color: #ffff66">當 Nslookup.exe 啟動時，會執行反向對應以取得預設伺服器的名稱。如果沒有 PTR 資料，就會傳回此錯誤訊息</span>。 如果要修正這個問題，請確認反向對應區域存在，並包含名稱伺服器的 PTR 記錄。</span></strong><br /><br />解決辦法：在DNS伺服器上建立 192.168.1254 的IP反解即可解決<br /><br />處理步驟:<br/><br/><span style="color: #0000FF;">1.編輯 /etc/named.conf<br/>2.加入以下的內容 ( 192.168.1.x 的反解宣告 )</span><br/><div class="code"><br/> &nbsp; &nbsp; &nbsp; &nbsp;zone &quot;1.168.192.in-addr.arpa&quot; IN &#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type master;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file &quot;named.192.168.1&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;allow-update &#123; none; &#125;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;&#125;;<br/></div><br/><span style="color: #0000FF;">3.增加 /var/named/chroot/var/named/named.192.168.1 檔案<br/>4.加入以下的內容 ( 192.168.1.x 的反解設定 )</span><br/><div class="code"><br/>$TTL &nbsp; &nbsp;86400<br/>@ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;SOA &nbsp; &nbsp;dns.linux &nbsp; &nbsp;root.dns.linux. (<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2007060701 &nbsp;; serial<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;28800 &nbsp; &nbsp; &nbsp; ; refresh<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7200 &nbsp; &nbsp; &nbsp; &nbsp;; retry<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;604800 &nbsp; &nbsp; &nbsp;; expire<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; &nbsp; &nbsp; ; default_ttl<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<br/>@ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;ns1.dns.linux.<br/>254 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IN &nbsp; &nbsp; &nbsp;PTR &nbsp; &nbsp; ns1.dns.linux.<br/></div><br/><span style="color: #0000FF;">5.完成後，restart named 或 &nbsp;reload named 即可</span><br/><br/><span style="color: #FF0000;">這樣於 Windows 下設定預設使用 192.168.1.254 來當 DNS 查詢時，使用 Nslookup.exe 時就不會在出現<strong>*** Can't find server name for address 192.168.1.254: Non-existent domain</strong> &nbsp;(找不到伺服器名稱 的錯誤訊息了)</span><br/><br/>以下內容來自於：<a href="http://support.microsoft.com/kb/200525/zh-tw" target="_blank">微軟技術支援</a><br/><br/><strong>疑難排解 Nslookup.exe<br/>預設伺服器逾時</strong><br/>啟動 Nslookup.exe 公用程式時，可能會發生下列錯誤：<br/><br/><span style="color: #FF0000;">*** Can't find server name for address w.x.y.z: Timed out (*** 找不到位址 w.x.y.z 的伺服器名稱：逾時) </span><br/><br/><strong>注意：</strong>w.x.y.z 是「DNS 服務搜尋順序」清單中列出的第一個 DNS 伺服器。<br/><br/><br/><span style="color: #FF0000;">*** Can't find server name for address 127.0.0.1:Timed out (*** 找不到位址 127.0.0.1 的伺服器名稱：逾時) </span><br/><br/>第一個錯誤代表無法聯繫 DNS 伺服器，或未在該電腦上執行服務。如果要修正這個問題，請在該伺服器上啟動 DNS 服務或檢查可能的連線問題。<br/><br/>第二個錯誤代表「DNS 服務搜尋順序」清單中未定義任何伺服器。如果要修正這個問題，請將有效 DNS 伺服器的 IP 位址新增至此清單中。 <br/><br/>如需詳細資訊，請參閱「Microsoft 知識庫」中的下列文件：<br/><br/><a href="http://support.microsoft.com/kb/172060/" target="_blank">172060</a> NSLOOKUP：Can't Find Server Name for Address 127.0.0.1<br/><strong>啟動 Nslookup.exe 時找不到伺服器名稱</strong><br/>啟動 Nslookup.exe 公用程式時，可能會發生下列錯誤：<br/><br/><br/><span style="color: #FF0000;">*** Can't find server name for address w.x.y.z: Non-existent domain (*** 找不到位址 w.x.y.z 的伺服器名稱：不存在的網域) </span><br/><br/><br/>當名稱伺服器的 IP 位址沒有 PTR 記錄時，可能就會發生這個錯誤。 當 Nslookup.exe 啟動時，會執行反向對應以取得預設伺服器的名稱。如果沒有 PTR 資料，就會傳回此錯誤訊息。 如果要修正這個問題，請確認反向對應區域存在，並包含名稱伺服器的 PTR 記錄。<br/><br/>如需詳細資訊，請參閱「Microsoft 知識庫」中的下列文件：<br/><br/><a href="http://support.microsoft.com/kb/172953/" target="_blank">172953</a> 如何安裝並設定 Microsoft DNS Server<br/><strong>子網域上的 Nslookup 失敗</strong><br/>在子網域上查詢或執行區域轉送時，Nslookup 可能會傳回下列錯誤：<br/><br/><br/><span style="color: #FF0000;">*** ns.domain.com can't find child.domain.com.: Non-existent domain (*** ns.domain.com 找不到 child.domain.com.：不存在的網域) <br/>*** Can't list domain child.domain.com.: Non-existent domain (*** 無法列出網域 child.domain.com.：不存在的網域) </span><br/><br/><br/>在 DNS Manager 中，可在主要區域下方新增網域，以建立子網域。以此種方式建立子網域不會個別建立網域的 db 檔案，因此，查詢該網域或在該網域上執行區域轉送將導致前述錯誤。 在父系網域上執行區域轉送，會同時列出父系網域與子網域的資料。如果需要替代的解決方案，請在 DNS 伺服器上為子網域建立新的主要區域。 <br/></span></span>
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?136</link>
<title><![CDATA[BIND master/slave DNS 與 view 的搭配]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Thu, 07 Jun 2007 07:59:43 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?136</guid> 
<description>
<![CDATA[ 
	由於 BIND 提供了一個方便的 view 功能, 可以讓我們在同一台機器上頭, 依據來查詢的 ip 的不同, 而回應不同的結果. 所以, 我們可以方便的把對內的 DNS 與對外的 DNS 都整合到同一台機器上頭處理. 如果是內部網路的機器來查詢時, 就回覆內部的 IP, 如果是外部的網路來查詢時, 就回覆外部的 IP. 管理員可以將內部與外部的 DNS, 整合到同一台機器管理 (當然, 還是要管理內部與外部不同的設定檔). 這在只有一個 DNS 主機時, 問題並不大, 但是, 如果我們有多台 DNS 主機時, 如何同步這些主機的設定, 就需要有一些技巧了.<br /><br /><p>以下為例子來看, 在只有一台 DNS 主機 (192.168.1.252) 時, 使用 view 的功能, 分別對內部的 ip 提供內部的 DNS, 而對外部的 ip 提供外部的 DNS. 在 bind 上頭的設定是:<br /><br/><div class="code"><br/>// master dns &nbsp;(eth1 ==&gt; 192.168.1.252)<br/>options &#123;<br/> &nbsp;directory &quot;/var/named&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;allow-query &nbsp; &nbsp;&#123; any; &#125;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;allow-transfer &nbsp;&#123;192.168.1.254;&#125;;<br/>&#125;;<br/><br/>view &quot;internal&quot; &#123;<br/> &nbsp; // This should match our internal networks.<br/> &nbsp; match-clients &#123;<br/> &nbsp; &nbsp; &nbsp;127.0.0.1/24;<br/> &nbsp; &nbsp; &nbsp;192.168.0.0/24;<br/> &nbsp; &#125;;<br/><br/> &nbsp; // Provide recursive service to internal clients only.<br/> &nbsp; recursion yes;<br/><br/> &nbsp;zone &quot;.&quot; IN &#123;<br/> &nbsp; &nbsp; type hint;<br/> &nbsp; &nbsp; file &quot;named.ca&quot;;<br/> &nbsp;&#125;;<br/><br/> &nbsp;zone &quot;localhost&quot; IN &#123;<br/> &nbsp; &nbsp; type master;<br/> &nbsp; &nbsp; file &quot;localhost.zone&quot;;<br/> &nbsp; &nbsp; allow-update &#123; none; &#125;;<br/> &nbsp;&#125;;<br/><br/> &nbsp; zone &quot;xspace.idv.tw&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;type master;<br/> &nbsp; &nbsp; &nbsp;file &quot;db.xspace.idv.tw_internal&quot;;<br/> &nbsp; &#125;;<br/>&#125;;<br/><br/>view &quot;external&quot; &#123;<br/> &nbsp; // Match ant client<br/> &nbsp; match-clients &#123;<br/> &nbsp; &nbsp; &nbsp;any;<br/> &nbsp; &#125;;<br/><br/> &nbsp; // Refuse recursive service to external clients.<br/> &nbsp; recursion no;<br/><br/> &nbsp;zone &quot;.&quot; IN &#123;<br/> &nbsp; &nbsp; type hint;<br/> &nbsp; &nbsp; file &quot;named.ca&quot;;<br/> &nbsp;&#125;;<br/><br/> &nbsp;zone &quot;localhost&quot; IN &#123;<br/> &nbsp; &nbsp; type master;<br/> &nbsp; &nbsp; file &quot;localhost.zone&quot;;<br/> &nbsp; &nbsp; allow-update &#123; none; &#125;;<br/> &nbsp;&#125;;<br/><br/> &nbsp; zone &quot;xspace.idv.tw&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;type master;<br/> &nbsp; &nbsp; &nbsp;file &quot;db.xspace.idv.tw_external&quot;;<br/> &nbsp; &#125;;<br/>&#125;; <br/><br/>include &quot;/etc/rndc.key&quot;;<br/></div><br /></p><p>這個設定檔, 會依據來源的 IP 來決定使用那個設定檔回應. 且對外可以關閉 recursion 查詢, 只開放內部的 IP 使用 recursion 的功能.</p><p>如果這時, 我們要新增另一台 slave DNS (192.168.1.254) 時, 依照沒有 view 時的想法, 然後套上 view 之後, 應該很簡單的用下頭的設定檔來處理:<br /><br/><div class="code"><br/>// slave dns &nbsp;(eth1 ==&gt; 192.168.1.254)<br/>options &#123;<br/> &nbsp;directory &quot;/var/named&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;allow-query &nbsp; &nbsp;&#123; any; &#125;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;allow-transfer &nbsp;&#123;192.168.1.254;&#125;;<br/>&#125;;<br/><br/>view &quot;internal&quot; &#123;<br/> &nbsp; // This should match our internal networks.<br/> &nbsp; match-clients &#123;<br/> &nbsp; &nbsp; &nbsp;127.0.0.1/24;<br/> &nbsp; &nbsp; &nbsp;192.168.0.0/24;<br/> &nbsp; &#125;;<br/><br/> &nbsp; // Provide recursive service to internal clients only.<br/> &nbsp; recursion yes;<br/><br/> &nbsp;zone &quot;.&quot; IN &#123;<br/> &nbsp; &nbsp; type hint;<br/> &nbsp; &nbsp; file &quot;named.ca&quot;;<br/> &nbsp;&#125;;<br/><br/> &nbsp;zone &quot;localhost&quot; IN &#123;<br/> &nbsp; &nbsp; type master;<br/> &nbsp; &nbsp; file &quot;localhost.zone&quot;;<br/> &nbsp; &nbsp; allow-update &#123; none; &#125;;<br/> &nbsp;&#125;;<br/><br/> &nbsp; zone &quot;xspace.idv.tw&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;type slave;<br/> &nbsp; &nbsp; &nbsp;file &quot;slaves/db.xspace.idv.tw_internal&quot;;<br/> &nbsp; &nbsp; &nbsp;masters &#123; 192.168.1.252; &#125;;<br/> &nbsp; &#125;;<br/>&#125;;<br/><br/>view &quot;external&quot; &#123;<br/> &nbsp; // Match ant client<br/> &nbsp; match-clients &#123;<br/> &nbsp; &nbsp; &nbsp;any;<br/> &nbsp; &#125;;<br/><br/> &nbsp; // Refuse recursive service to external clients.<br/> &nbsp; recursion no;<br/><br/> &nbsp;zone &quot;.&quot; IN &#123;<br/> &nbsp; &nbsp; type hint;<br/> &nbsp; &nbsp; file &quot;named.ca&quot;;<br/> &nbsp;&#125;;<br/><br/> &nbsp;zone &quot;localhost&quot; IN &#123;<br/> &nbsp; &nbsp; type master;<br/> &nbsp; &nbsp; file &quot;localhost.zone&quot;;<br/> &nbsp; &nbsp; allow-update &#123; none; &#125;;<br/> &nbsp;&#125;;<br/><br/> &nbsp; zone &quot;xspace.idv.tw&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;type slave;<br/> &nbsp; &nbsp; &nbsp;file &quot;slaves/db.xspace.idv.tw_external&quot;;<br/> &nbsp; &nbsp; &nbsp;masters &#123; 192.168.1.252; &#125;;<br/> &nbsp; &#125;;<br/>&#125;; <br/><br/>include &quot;/etc/rndc.key&quot;;<br/></div><br /></p><p>這時, 問題就出現了. 當這台 slave DNS, 往 master DNS 查詢資料時, 由於這台機器的 IP 是 192.168.1.254, 屬於內部的 &nbsp;192.168.0.0/24 裡頭, 所以... 內部的 DNS 資料並不會有問題, 可以得到正確的內部資料, 可是... 對於外部的 slave DNS 來說, 去 master DNS 查詢時, 也被視為內部的 IP, 當然也只得到內部的 DNS 資料. 並不會得到外部的 DNS 資料.</p><p>所以, 為了避免這個問題, 我們可以讓 master DNS 新增一個 IP 與 slave DNS 新增兩個 IP, 然後利用這個 IP 來避免取得內部的 DNS 資料, 真正能取得外部的 DNS 資料.</p><p><span style="color: #FF0000;">這裡我們新增 10.10.10.252 (eth1:0) 給 master DNS , 然後新增 10.10.10.253 (eth1:0) 及 10.10.10.254 (eth1:1) 給 slave DNS</span>, 然後把 master DNS 的設定改成:<br /><br/><div class="code"><br/>// master dns &nbsp;(eth1 ==&gt; 192.168.1.252 &nbsp;eth1:0 ==&gt; 10.10.10.252)<br/>options &#123;<br/> &nbsp;directory &quot;/var/named&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;allow-query &nbsp; &nbsp;&#123; any; &#125;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;allow-transfer &nbsp;&#123;10.10.10.253;10.10.10.254; &#125;;<br/>&#125;;<br/><br/>view &quot;internal&quot; &#123;<br/> &nbsp; // This should match our internal networks.<br/> &nbsp; match-clients &#123;<br/> &nbsp; &nbsp; &nbsp;!10.10.10.253;<br/> &nbsp; &nbsp; &nbsp;127.0.0.1/24;<br/> &nbsp; &nbsp; &nbsp;192.168.0.0/24;<br/> &nbsp; &#125;;<br/> &nbsp; // Provide recursive service to internal clients only.<br/> &nbsp; recursion yes;<br/><br/> &nbsp;zone &quot;.&quot; IN &#123;<br/> &nbsp; &nbsp; type hint;<br/> &nbsp; &nbsp; file &quot;named.ca&quot;;<br/> &nbsp;&#125;;<br/><br/> &nbsp;zone &quot;localhost&quot; IN &#123;<br/> &nbsp; &nbsp; type master;<br/> &nbsp; &nbsp; file &quot;localhost.zone&quot;;<br/> &nbsp; &nbsp; allow-update &#123; none; &#125;;<br/> &nbsp;&#125;;<br/><br/> &nbsp; zone &quot;xspace.idv.tw&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;type master;<br/> &nbsp; &nbsp; &nbsp;file &quot;db.xspace.idv.tw_internal&quot;;<br/> &nbsp; &#125;;<br/>&#125;;<br/><br/>view &quot;external&quot; &#123;<br/> &nbsp; // Match ant client<br/> &nbsp; match-clients &#123;<br/> &nbsp; &nbsp; &nbsp;any;<br/> &nbsp; &#125;;<br/><br/> &nbsp; // Refuse recursive service to external clients.<br/> &nbsp; recursion no;<br/><br/> &nbsp;zone &quot;.&quot; IN &#123;<br/> &nbsp; &nbsp; type hint;<br/> &nbsp; &nbsp; file &quot;named.ca&quot;;<br/> &nbsp;&#125;;<br/><br/> &nbsp;zone &quot;localhost&quot; IN &#123;<br/> &nbsp; &nbsp; type master;<br/> &nbsp; &nbsp; file &quot;localhost.zone&quot;;<br/> &nbsp; &nbsp; allow-update &#123; none; &#125;;<br/> &nbsp;&#125;;<br/><br/> &nbsp; zone &quot;xspace.idv.tw&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;type master;<br/> &nbsp; &nbsp; &nbsp;file &quot;db.xspace.idv.tw_external&quot;;<br/> &nbsp; &#125;;<br/>&#125;; <br/><br/>include &quot;/etc/rndc.key&quot;;<br/></div><br /></p><p><span style="color: #990000">把 10.10.10.0/24 排除在 internal 的 view 範圍內.</span><br /><br /></p><p>然後把 slave DNS 的設定改成:<br /><br/><div class="code"><br/>// slave dns &nbsp;(eth1 ==&gt; 192.168.1.254 &nbsp;eth1:0 &nbsp;==&gt; 10.10.10.253 &nbsp; &nbsp;eth1:1 ==&gt; 10.10.10.254)<br/>options &#123;<br/> &nbsp;directory &quot;/var/named&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;allow-query &nbsp; &nbsp;&#123; any; &#125;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;allow-transfer &nbsp;&#123;10.10.10.253;10.10.10.254; &#125;;<br/>&#125;;<br/><br/>view &quot;internal&quot; &#123;<br/> &nbsp; // This should match our internal networks.<br/> &nbsp; match-clients &#123;<br/> &nbsp; &nbsp; &nbsp;127.0.0.1/24;<br/> &nbsp; &nbsp; &nbsp;192.168.0.0/24;<br/> &nbsp; &#125;;<br/> &nbsp; // Provide recursive service to internal clients only.<br/> &nbsp; recursion yes;<br/><br/> &nbsp;zone &quot;.&quot; IN &#123;<br/> &nbsp; &nbsp; type hint;<br/> &nbsp; &nbsp; file &quot;named.ca&quot;;<br/> &nbsp;&#125;;<br/><br/> &nbsp;zone &quot;localhost&quot; IN &#123;<br/> &nbsp; &nbsp; type master;<br/> &nbsp; &nbsp; file &quot;localhost.zone&quot;;<br/> &nbsp; &nbsp; allow-update &#123; none; &#125;;<br/> &nbsp;&#125;;<br/><br/> &nbsp; zone &quot;xspace.idv.tw&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;type slave;<br/> &nbsp; &nbsp; &nbsp;file &quot;slaves/db.xspace.idv.tw_internal&quot;;<br/> &nbsp; &nbsp; &nbsp;masters &#123; 10.10.10.252; &#125;;<br/> &nbsp; &nbsp; &nbsp;transfer-source 10.10.10.254;<br/> &nbsp; &#125;;<br/>&#125;;<br/><br/>view &quot;external&quot; &#123;<br/> &nbsp; // Match ant client<br/> &nbsp; match-clients &#123;<br/> &nbsp; &nbsp; &nbsp;any;<br/> &nbsp; &#125;;<br/><br/> &nbsp; // Refuse recursive service to external clients.<br/> &nbsp; recursion no;<br/><br/> &nbsp;zone &quot;.&quot; IN &#123;<br/> &nbsp; &nbsp; type hint;<br/> &nbsp; &nbsp; file &quot;named.ca&quot;;<br/> &nbsp;&#125;;<br/><br/> &nbsp;zone &quot;localhost&quot; IN &#123;<br/> &nbsp; &nbsp; type master;<br/> &nbsp; &nbsp; file &quot;localhost.zone&quot;;<br/> &nbsp; &nbsp; allow-update &#123; none; &#125;;<br/> &nbsp;&#125;;<br/><br/> &nbsp; zone &quot;xspace.idv.tw&quot; &#123;<br/> &nbsp; &nbsp; &nbsp;type slave;<br/> &nbsp; &nbsp; &nbsp;file &quot;slaves/db.xspace.idv.tw_external&quot;;<br/> &nbsp; &nbsp; &nbsp;masters &#123; 10.10.10.252; &#125;;<br/> &nbsp; &nbsp; &nbsp;transfer-source 10.10.10.253;<br/> &nbsp; &#125;;<br/>&#125;; <br/><br/>include &quot;/etc/rndc.key&quot;;<br/></div><br /></p><p><span style="color: #990000">在 internal 的設定上頭, 利用 transfer-source 指定使用 10.10.10.254的 ip 去查詢 10.10.10.252 的 DNS, 以便於得到內部的 DNS 資料. 而在 external 的設定中, 利用 transfer-source 指定使用 10.10.10.253 的 ip, 去查詢 10.10.10.252 的 DNS, 以便於取得外部的 DNS 資料.</span></p><p><span style="color: #990000">如此設定後, 就可以讓這兩台主機, &nbsp;能夠同時同步內部與外部的 DNS 設定了.</span><br /></p>
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?135</link>
<title><![CDATA[BIND9 - Master / Slave DNS 基本設定]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Thu, 07 Jun 2007 03:26:52 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?135</guid> 
<description>
<![CDATA[ 
	<li>named.conf 重點內容 </li><li>Slave 主機向 Master 要求傳送 Zone File 的時機 </li><li>Zone File 檔案結構<br /><br /><p><span style="color: #cc0000">named.conf 重點內容</span></p></li><span style="color: #FF4500;">Master:</span><br/><div class="code"><br/>vi /etc/named.conf<br/><br/>acl &quot;trusted&quot; &#123; 127.0.0.1; 192.168.0.0/22; &#125;;<br/><br/>options &#123;<br/><br/>allow-query &nbsp; &nbsp;&#123; any; &#125;; &nbsp;// 是否允許被查詢？當然要可以被查詢；<br/>allow-recursion &#123; trusted; &#125;; //避免變成 Open DNS<br/>allow-transfer &#123; none; &#125;; //預設禁止 Zone Transfer<br/>notify no; //預設不通知轄區 DNS Server<br/><br/>&#125;;<br/><br/>zone &quot;mydomain.com&quot; in &#123;<br/><br/>type master;<br/>file &quot;mydomain.com.zone&quot;;<br/>allow-transfer &#123; slave.ip.address; &#125;;<br/>notify yes;<br/><br/>&#125;;<br/><br/>zone &quot;1.168.192.in-addr.arpa&quot; in &#123;<br/><br/>type master;<br/>file &quot;192.168.1.zone&quot;;<br/>allow-transfer &#123; slave.ip.address; &#125;;<br/>notify yes;<br/><br/>&#125;;<br/></div><br/><span style="color: #FF4500;">Slave:</span><br/><div class="code"><br/>vi /etc/named.conf<br/><br/>zone &quot;mydomain.com&quot; in &#123;<br/><br/>type slave;<br/>file &quot;slave/mydomain.com.zone&quot;;<br/>masters &#123; master.ip.address; &#125;;<br/><br/>&#125;;<br/><br/>zone &quot;1.168.192.in-addr.arpa&quot; in &#123;<br/><br/>type slave;<br/>file &quot;slave/192.168.1.zone&quot;;<br/>masters &#123; master.ip.address; &#125;;<br/><br/>&#125;;<br/></div><br/><br/><span style="color: #FFA500;">Slave 主機向 Master 要求傳送 Zone File 的時機</span><br/>1. master 主機上的 named 啟動、Reload 時, 發送 dns notify 信號通知 NS 主機 (除本身外) 比對 zone file serial, 且 master serial 大於 slave serial 時. <br/>2. slave 主機上的 named 啟動時, 發現 master serial 大於 slave serial, 或無 zone file 存在時. <br/>3. slave 主機每隔 refresh 時間, 向 master 查詢 zone file serial, 發現 master serial 大於 slave serial 時. <br/><strong><span style="color: #FFA500;">Zone File 檔案結構</span></strong><br/><span style="color: #FF0000;">Forward Lookup / 正解</span><br/><div class="code"><br/>$TTL 1W<br/>@ &nbsp; &nbsp; &nbsp;IN &nbsp;SOA &nbsp;master_dns_fqdn zone_admin (<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2006092001 &nbsp;;serial<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2D &nbsp; &nbsp;;refresh<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4H &nbsp; &nbsp;;retry<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6W &nbsp; &nbsp;;expire<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1W ) &nbsp; &nbsp;;TTL<br/><br/> &nbsp; &nbsp; &nbsp;IN &nbsp;NS &nbsp;master_dns_fqdn<br/> &nbsp; &nbsp; &nbsp;IN &nbsp;NS &nbsp;slave_dns_fqdn<br/> &nbsp; &nbsp; &nbsp;IN &nbsp;MX 10 &nbsp;mail_server_fqdn<br/><br/>master_dns_hostname &nbsp;IN &nbsp;A &nbsp;ip_address<br/>slave_dns_hostname &nbsp;IN &nbsp;A &nbsp;ip_address<br/>mail_server_hostname &nbsp;IN &nbsp;A &nbsp;ip_address<br/>some_hostname &nbsp; &nbsp;IN &nbsp;CNAME &nbsp;another_hostname_has_A_record<br/></div><br/><span style="color: #FF0000;">Reverse Lookup / 反解 (其實設反解無用，因為反解目前由ISP管理)</span><br/><div class="code"><br/>$TTL 1W<br/>@ &nbsp; &nbsp; &nbsp;IN &nbsp;SOA &nbsp;master_dns_fqdn zone_admin (<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2006092001 &nbsp;;serial<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2D &nbsp; &nbsp;;refresh<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4H &nbsp; &nbsp;;retry<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6W &nbsp; &nbsp;;expire<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1W ) &nbsp; &nbsp;;TTL<br/><br/> &nbsp; &nbsp; &nbsp;IN &nbsp;NS &nbsp;master_dns_fqdn<br/><br/>entry_in_*.in-addr.arpa &nbsp;IN &nbsp;PTR &nbsp;some_host_fqdn<br/></div><br/><br/>ex1. zone: 20.10.150.in-addr.arpa<br/> &nbsp; &nbsp; &nbsp; &nbsp;in the zone file: 1 IN PTR ms1.mydomain.com<br/> &nbsp; &nbsp; &nbsp; &nbsp;retult: ms1.mydomain.com=150.10.20.1 <br/><br/>ex2. zone: 10.150.in-addr.arpa<br/> &nbsp; &nbsp; &nbsp; &nbsp;in the zone file: 2.20 IN PTR ms1.mydomain.com<br/> &nbsp; &nbsp; &nbsp; &nbsp;retult: ms1.mydomain.com=150.10.20.2 
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?134</link>
<title><![CDATA[架設單純的 forward DNS 主機設定 (cache-only)]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Thu, 07 Jun 2007 02:18:27 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?134</guid> 
<description>
<![CDATA[ 
	<strong>什麼是單純的 forward DNS 的主機呢？</strong> <div class="block2">在介紹怎麼設定每一個正反解的 zone 之前，我們先來玩一個簡單的 DNS 主機！就是 <span class="text_import2"><span style="color: #000088">cache-only DNS server </span></span>！ 也稱為 forward DNS 囉！顧名思義，這個 DNS server 只有 cache (快取) 的功能，也就是說，他本身並沒有主機名稱與 IP 正反解的設定檔， 完全是由對外的查詢來提供他的資料來源！整個運作的流程可以看成是這個樣子：<br /><br /><img src="attachment/200706/1181182492_0.jpg" border="0" width="411" height="277" /><br /><br />由上面的圖示來看，您可以發現，其實，我們 Client 端雖然都是使用 Cache-Only 的 DNS 在搜尋，但是，實際上 Cache-only 的主機都是請一個 ( Forwarders ) DNS 主機來幫忙查詢的，本身並沒有 zone 的設定檔啦！所以說，基本上， cache-only 的 DNS 只是一個中間傳遞資料的 DNS 主機罷了！那麼為什麼要架設這樣的一個 DNS 主機呢？閒閒沒事幹？當然不是！這是有原因的啦！底下說給您聽囉！<br /><br /><strong>什麼時候使用 cache-only DNS？<br /></strong><div class="block2">在某些公司行號裡頭，為了預防員工利用公司的網路資源作自己的事情，所以都會針對 Internet 的連線作比較嚴格的限制。當然啦，連 port 53 這個 DNS 會用到的 port 也可能會被擋在防火牆之外的～這個時候， 您可以在『<span class="text_import2"><span style="color: #000088">防火牆的那部機器上面，加裝一個 cache-only 的 DNS 服務！</span></span>』這是什麼意思呢？很簡單啊！就是您自己利用自己的 防火牆主機上的 DNS 服務去幫您的 Client 端解譯 hostname &lt;--&gt; IP 囉！因為防火牆主機 可以設定放行自己的 DNS 功能，而 Client 端就設定該防火牆 IP 為 DNS 主機的 IP 即可！ 哈哈！這樣就可以取得主機名稱與 IP 的轉譯啦！<br /><br /></div>那如何在你的 Linux 主機上架設一個 cache-only 的 DNS 主機呢？ 其實真的很簡單的啦！因為不需要設定正反解的 Zone ，所以只要設定一個檔案 (就是 named.conf) 即可！真是快樂得不得了吶！ 底下就讓我們來玩一玩吧！<br /><br /><br /><span class="text_import1"><span style="color: #000088"><strong>編輯主要設定檔 /etc/named.conf<br /><br /></strong><span style="color: #000000">在這個檔案中，主要是定義跟主機有關的事項，以及各個 Zone 的代表含意與檔案，在鳥哥的這個案例當中， 因為使用了 forward 的機制，所以鳥哥的這個 cache-only DNS 伺服器並沒有 Zone ，所以我們只要設定好跟主機有關的設定即可。設定這個檔案的時候請注意：<br /><br /></span><ul><span class="text_import2"><li><strong>註解資料是以兩條斜線『 // 』來作設定的！ </strong></li><li><strong>每個段落之後都需要以『 ; 』來做為結尾！ </strong></li></span></ul><br /><span style="color: #000000">那麼您可以這樣設定這個檔案！<br /><br /><br/><div class="code"> <br/>&#91;root@linux ~&#93;# vi /etc/named.conf<br/>// 雖然 CentOS 將這個檔案放置到 /var/named/chroot/etc 當中，<br/>// 不過他很好心的幫我們作了個連結，所以你還是可以直接編輯這個檔案啦！<br/>options &#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp;directory &quot;/var/named&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;dump-file &quot;/var/named/data/cache_dump.db&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;statistics-file &quot;/var/named/data/named_stats.txt&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;pid-file &quot;/var/run/named/named.pid&quot;; <br/> &nbsp; &nbsp; &nbsp; &nbsp;forward only; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//只允許 forward!<br/> &nbsp; &nbsp; &nbsp; &nbsp;forwarders &#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;168.95.1.1; &nbsp; &nbsp; &nbsp;//我這裡使用 hinet 的 DNS ！<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;139.175.10.20; &nbsp; //這個是 seednet 的 DNS ！<br/> &nbsp; &nbsp; &nbsp; &nbsp;&#125;;<br/>&#125;;<br/>include &quot;/etc/rndc.key&quot;;<br/></div><br /><br />我們僅動用到<span class="text_import2"><span style="color: #000088"> option </span></span>這個參數而已，裡面的設定值意義為：<br /><br /><ul><li><strong><span style="color: #000088"><span class="text_import1">pid-file</span><br /></span></strong>指的是每一個 services 記錄自己的 PID (Process ID) 的檔案囉！這個檔案通常用在重新啟動或者是 reload 整個 services 最常被使用到的！因為可以使用<span class="text_import2"><span style="color: #000088"> kill -1 PID</span></span> 來重新啟動啊！嗄！忘記什麼是 PID ？趕快拿出基礎篇複習一下！<br /></li><li><strong><span style="color: #000088"><span class="text_import1">forwarders</span><br /></span></strong>(不要忘記那個 s 喔！)就是要設定往前尋找的那個『合法』的 DNS 囉！每一個 forward 的主機之 IP 都需要有『 ; 』來做為結尾！<br /></li><li><strong><span style="color: #000088"><span class="text_import1">forward only</span><br /></span></strong>這個設定可以讓您的 DNS 主機僅進行 forward 而已！是 Cache-Only 主機最常見的設定了！ </li></ul><br />很簡單吧！ 這樣就已經設定完成了最簡單的 cache-only 的 DNS 主機了！</span></span></span></div>
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?131</link>
<title><![CDATA[DNS 的查詢指令： host, nslookup, dig]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Wed, 06 Jun 2007 08:20:43 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?131</guid> 
<description>
<![CDATA[ 
	<p><strong>@host<br /><br/><div class="code"><br/>語法：<br/>&#91;root@linux ~&#93;# host &#91;-a&#93; &#91;FQDN&#93; &#91;server&#93;<br/>&#91;root@linux ~&#93;# host -l &#91;domain&#93; &#91;server&#93;<br/>參數說明：<br/>-a ：代表列出該主機所有的相關資訊，包括 IP、TTL 等等<br/>-l ：若後面接的那個 domain 設定允許 allow-transfer 時，則列出該 domain<br/>所管理的所有主機名稱對應資料！<br/>server：這個參數可有可無，當想要利用非 /etc/resolv.conf 內的 DNS 主機<br/>來查詢主機名稱與 IP 的對應時，就可以利用這個參數了！<br/><br/>範例一：強制以 192.168.1.254 這部 DNS 主機來查詢<br/>&#91;root@linux ~&#93;# host www.vbird.tsai 192.168.1.254<br/>Using domain server:<br/>Name: 192.168.1.254<br/>Address: 192.168.1.254#53 &lt;==這裡重要！告知這筆記錄是哪部 DNS 伺服器去找的！<br/>Aliases:<br/><br/>www.vbird.tsai is an alias for linux.vbird.tsai.<br/>linux.vbird.tsai has address 192.168.1.254<br/></div><br/><br /></strong>有注意到上面輸出的特殊字體部分嗎？很多朋友在測試自己的 DNS 時，常常會『指定到錯誤的 DNS 查詢主機』了～ 因為他們的 /etc/reslov.conf 忘記改，所以老是找不到自己設定的資料庫 IP 資料。</p><br/><div class="code"><br/>範例二：找出我們自己這個 vbird.tsai 領域的所有主機對應<br/>&#91;root@linux ~&#93;# host -l vbird.tsai 192.168.1.254<br/>Using domain server:<br/>Name: 192.168.1.254<br/>Address: 192.168.1.254#53<br/>Aliases:<br/><br/>vbird.tsai name server linux.vbird.tsai.<br/>vbird.tsai name server slave.vbird.tsai.<br/>linux.vbird.tsai has address 192.168.1.254<br/>slave.vbird.tsai has address 192.168.1.150<br/>....後面省略....<br/></div><br/><p>上面的資訊可就熟悉多了吧？！沒錯！那就是我們在 named.vbird.tsai 裡面的設定值啊！ 不過，並不是所有的 domain 都可以作這樣的事情～舉例來說，如果我們下達：</p><br/>[cdoe]<br/>[root@linux ~]# host -l yahoo.com<br/>Host yahoo.com not found: 5(REFUSED)<br/>; Transfer failed.<br/>[/code]<br/><br />這樣的回應是因為在對方的 /etc/named.conf 裡面並沒有設定 allow-transfer 那個設定選項的原因啊！ 至於 host -a 的輸出資訊與 dig 是一模一樣的，所以我們先不介紹，在 dig 處再詳細說明。</p><p>@nslookup</p><br/><div class="code"><br/>語法：<br/>&#91;root@linux ~&#93;# nslookup &#91;FQDN&#93; &#91;server&#93;<br/>&#91;root@linux ~&#93;# nslookup<br/>參數說明：<br/>1. 可以直接在 nslookup 加上待查詢的主機名稱或者是 IP ，&#91;server&#93; 可有可無；<br/>2. 如果在 nslookup 後面沒有加上任何主機名稱或 IP ，那將進入 nslookup 的查詢功能<br/>在 nslookup 的查詢功能當中，可以輸入其他參數來進行特殊查詢，例如：<br/>set type=any ：列出所有的資訊『正解方面設定檔』<br/>set type=mx ：列出與 mx 相關的資訊！<br/><br/>範例一：直接搜尋 winxp.vbird.tsai 的 IP 資訊<br/>&#91;root@linux ~&#93;# nslookup winxp.vbird.tsai 192.168.1.254<br/>Server: 192.168.1.254<br/>Address: 192.168.1.254#53 &lt;==同樣的，請注意搜尋的 DNS IP 喔！<br/><br/>Name: winxp.vbird.tsai<br/>Address: 192.168.1.100<br/></div><br/><br />nslookup 可單純的將 hostname 與 IP 對應列出而已，不過，還是會將查詢的 DNS 主機的 IP 列出來的！ 如果想要知道更多詳細的參數，那可以直接進入 nslookup 這個軟體的操作畫面中，如下範例：</p><br/><div class="code"><br/>&#91;root@linux ~&#93;# nslookup &lt;==進入 nslookup 查詢畫面<br/>&gt; 192.168.1.254 &lt;==執行反解的查詢<br/>&gt; www.vbird.tsai &lt;==執行正解的查詢<br/># 上面這兩個僅列出正反解的資訊，沒有啥了不起的地方啦！<br/>&gt; tw.yahoo.com &lt;==執行非本機上的查詢<br/>Server: 192.168.1.254<br/>Address: 192.168.1.254#53<br/><br/>Non-authoritative answer:<br/># 注意這邊，因為不是自己的資料庫，所以是未認證過的資料(可能是快取)<br/>tw.yahoo.com canonical name = tw.yahoo-ap1.akadns.net.<br/>tw.yahoo-ap1.akadns.net canonical name = vip1.tw.tpe.yahoo.com.<br/>Name: vip1.tw.tpe.yahoo.com<br/>Address: 202.43.195.52<br/>&gt; set type=any &lt;==變更查詢，不是僅有 A，全部資訊都列出來<br/>&gt; sun.vbird.tsai<br/>Server: 192.168.1.254<br/>Address: 192.168.1.254#53<br/><br/>Name: sun.vbird.tsai<br/>Address: 192.168.1.200<br/>sun.vbird.tsai text = 「The sun solaris OS」 &lt;==看吧！更多資訊跑出來！<br/>sun.vbird.tsai hinfo = &quot;Celeron 1G&quot; &quot;Solaris 10&quot;<br/>&gt; exit<br/></div><br/><br />在上面的案例當中，請注意，如果您在 nslookup 的查詢畫面當中，輸入 set type=any 或其他參數， 那麼就無法再進行反解的查詢了！這是因為 any 或者是 mx 等等的標誌都是記錄在正解 zone 當中的緣故！</p><p>@dig</p><br/><div class="code"><br/>語法：<br/>&#91;root @test root&#93;# dig &#91;@server&#93; &#91;FQDN&#93; &#91;type&#93;<br/>參數說明：<br/>@server ：如果不想以 /etc/resolv.conf 來作為 DNS 主機，則可在此填入其他的 IP<br/>type ：預設是查詢 A 標誌，你可以在這裡入其他的標誌，如 mx, ns 等。<br/>此功能亦可使用 &#91;-t type&#93; 來處理。<br/><br/>範例一：查詢 linux.vbird.tsai 吧！<br/>&#91;root@linux ~&#93;#<br/>dig @61.31.233.1 siko.no-ip.org<br/><br/>; &lt;&lt;&gt;&gt; DiG 9.2.5 &lt;&lt;&gt;&gt; @61.31.233.1 siko.no-ip.org<br/>; (1 server found)<br/>;; global options: printcmd<br/>;; Got answer:<br/>;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 54045<br/>;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 1<br/><br/>;; QUESTION SECTION:<br/>;siko.no-ip.org. IN A<br/><br/>;; ANSWER SECTION:<br/>siko.no-ip.org. 60 IN A 219.81.151.45<br/><br/>;; AUTHORITY SECTION:<br/>no-ip.org. 15889 IN NS nf1.no-ip.com.<br/>no-ip.org. 15889 IN NS nf2.no-ip.com.<br/>no-ip.org. 15889 IN NS nf3.no-ip.com.<br/><br/>;; ADDITIONAL SECTION:<br/>nf1.no-ip.com. 45976 IN A 204.16.252.8<br/><br/>;; Query time: 268 msec<br/>;; SERVER: 61.31.233.1#53(61.31.233.1)<br/>;; WHEN: Sat Mar 17 00:43:02 2007<br/>;; MSG SIZE rcvd: 127<br/></div><br/><p>在這個範例當中，我們可以看到整個顯示出的訊息包括有幾個部分：</p><p>* HEADER(標題)：顯示查詢的內容有哪些，包括一個 query, 一個 answer 及兩個驗證部分。<br />* QUESTION(問題)：顯示所要查詢的內容，因為我們是查詢 linux.vbird.tsai 所以這裡自然就是顯示這個訊息。<br />* ANSWER(回應)：依據剛剛的 QUESTION 去查詢所得到的結果，因為在我們的設定當中僅有設定了 A 的標籤，所以這裡自然就&hellip;.<br />* AUTHORITY(驗證)：由這裡我們可以查閱 vbird.tsai 這個領域是由 linux.vbird.tsai 及 slave.vbird.tsai 來設定的～裡面那個 600 是什麼呢？很簡單，他就是我們所設定的 ttl 那個數值啦！ </p><br/><div class="code"><br/>範例二：查詢 vbird.tsai 這個領域的 MX 吧！<br/>&#91;root@linux ~&#93;# dig @192.168.1.254 vbird.tsai mx<br/>; &lt;&lt;&gt;&gt; DiG 9.2.4 &lt;&lt;&gt;&gt; @192.168.1.254 vbird.tsai mx<br/>; (1 server found)<br/>;; global options: printcmd<br/>;; Got answer:<br/>;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 3390<br/>;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2<br/><br/>;; QUESTION SECTION:<br/>;vbird.tsai. IN MX &lt;==瞧！要求的資料不一樣了喔！<br/><br/>;; ANSWER SECTION:<br/>vbird.tsai. 600 IN MX 10 linux.vbird.tsai.<br/><br/>;; AUTHORITY SECTION:<br/>vbird.tsai. 600 IN NS slave.vbird.tsai.<br/>vbird.tsai. 600 IN NS linux.vbird.tsai.<br/><br/>;; ADDITIONAL SECTION:<br/>linux.vbird.tsai. 600 IN A 192.168.1.254<br/>slave.vbird.tsai. 600 IN A 192.168.1.150<br/><br/>;; Query time: 4 msec<br/>;; SERVER: 192.168.1.254#53(192.168.1.254)<br/>;; WHEN: Thu Oct 19 15:45:58 2006<br/>;; MSG SIZE rcvd: 116<br/></div><br/><br />由於 dig 的輸出資訊實在是太豐富了，又分成多個部分去進行回報，因此很適合作為 DNS 追蹤回報的一個指令呢！ 你可以透過這個指令來瞭解一下你所設定的 DNS 資料庫是否正確，並進行除錯。</p><p><a href="http://linux.vbird.org/linux_server/0350dns.php#host"><span style="color: #72a545">資料來源:鳥哥</span></a></p>
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?82</link>
<title><![CDATA[在bind9上做view功能]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Mon, 02 Apr 2007 17:55:06 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?82</guid> 
<description>
<![CDATA[ 
	是一個dns，但是是同一個域，之所以這個dns即對內有對外，是因為它的服務地址確實是內網的ip，但通過NAT後對外服務，這時候又有一台主機，也是即對外又對內，系統是內部ip,也通過NAT對外服務，這時候，這個DNS就有我上述的需求了！希望給外網的客戶端返回外網ip,而對內網用戶則返回內部ip!我現在也不清楚dns能否實現這個功能，即使不能，其它的能否實現，如通過防火牆等! <br /><p></p><p>在bind9上可以做出你要的功能，在bind8上就只能用兩台DNS來做。 </p><p>用 bind 9.xx 的 view 功能可以實現 dns 對不同網段返回不同的地址 </p><br/>named.conf 有以下內容： <br/><div class="code"><br/>view &quot;internal&quot; &#123; <br/> &nbsp; &nbsp; &nbsp; // This should match our internal networks. <br/> &nbsp; &nbsp; &nbsp; match-clients &#123; 10.0.0.0/8; &#125;; <br/> &nbsp; &nbsp; &nbsp; // Provide recursive service to internal clients only. <br/> &nbsp; &nbsp; &nbsp; recursion yes; <br/> &nbsp; &nbsp; &nbsp; zone &quot;.&quot; &#123; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type hint; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file &quot;/etc/namedb/named.root&quot;; <br/> &nbsp; &nbsp; &nbsp; &#125;; <br/> &nbsp; &nbsp; &nbsp; zone &quot;0.0.127.IN-ADDR.ARPA&quot; &#123; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;type master; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file &quot;/etc/namedb/localhost.rev&quot;; <br/> &nbsp; &nbsp; &nbsp; &#125;; <br/> &nbsp; &nbsp; &nbsp; // Provide a complete view of the mydomain.com zone <br/> &nbsp; &nbsp; &nbsp; // including addresses of internal hosts. <br/> &nbsp; &nbsp; &nbsp; zone &quot;mydomain.com&quot; &#123; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type master; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file &quot;/etc/namedb/zone.mydomain.com.internal&quot;; <br/> &nbsp; &nbsp; &nbsp; &#125;; <br/>&#125;; <br/><br/>view &quot;external&quot; &#123; <br/> &nbsp; &nbsp; &nbsp; match-clients &#123; any; &#125;; <br/> &nbsp; &nbsp; &nbsp; // Refuse recursive service to external clients. <br/> &nbsp; &nbsp; &nbsp; recursion no; <br/> &nbsp; &nbsp; &nbsp; // Provide a restricted view of the mydomain.com zone <br/> &nbsp; &nbsp; &nbsp; // containing only publicly accessible hosts. <br/> &nbsp; &nbsp; &nbsp; zone &quot;mydomain.com&quot; &#123; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type master; <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file &quot;/etc/namedb/zone.mydomain.com.external&quot;; <br/> &nbsp; &nbsp; &nbsp; &#125;; <br/>&#125;; <br/></div>
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?81</link>
<title><![CDATA[DNS 又一解決方案：izidns = bind + PowerAdmin]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Mon, 02 Apr 2007 17:54:31 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?81</guid> 
<description>
<![CDATA[ 
	DNS 又一解決方案：izidns = bind + PowerAdmin <br /><br /><br />〔關鍵詞〕<br /><br />&nbsp;&nbsp;isidns&nbsp;&nbsp;bind&nbsp;&nbsp;PowerAdmin&nbsp;&nbsp;pdns&nbsp;&nbsp;easydns<br /><br />〔概要〕<br /><br />　　曾經使用過 pdns ，它的前台界面 PowerAdmin 管理界面非常好用，一經使用就不再想用別的。<br /><br />　　但如果說使用 DNS，絕大多數人還是更喜歡使用 bind 而不是別的。<br /><br />　　於是有人就想（比如我），PowerAdmin 管理界面要是能支持 bind 該多好呀！！！<br /><br />　　本想自己摸索摸索，但在 sourceforge 一找，不必了，因為有德國朋友早已經為我們做了一個 PowerAdmin 到 bind 9 的一個嫁接，令 bind9 + PowerAdmin 管理環境的搭建變得非常容易。它名字也很直觀，叫作 izidns，估計讀音類似於英語中的 easydns 吧。<br />
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?80</link>
<title><![CDATA[一個典型的dns配置方案]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Mon, 02 Apr 2007 17:21:26 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?80</guid> 
<description>
<![CDATA[ 
	options &#123;<br />directory &quot;/var/named&quot;;<br />&#125;;<br /><br />controls &#123;<br />inet 127.0.0.1 allow &#123; localhost; &#125; keys &#123; rndckey; &#125;;<br />&#125;;<br />zone &quot;.&quot; IN &#123;<br />type hint;<br />file &quot;named.ca&quot;;<br />&#125;;<br /><br />zone &quot;localhost&quot; IN &#123;<br />type master;<br />file &quot;localhost.zone&quot;;<br />allow-update &#123; none; &#125;;<br />&#125;;<br /><br />zone &quot;0.0.127.in-addr.arpa&quot; IN &#123;<br />type master;<br />file &quot;named.local&quot;;<br />allow-update &#123; none; &#125;;<br />&#125;;<br /><br /><span style="color: red">以上是系統默認的本地配置，不需要修改。以下為你適合本機的配置，我已經寫出來了。<br />zone &quot;0.168.192.in-addr.arpa&quot; IN &#123;<br />type master; // 角色為主域名服務器<br />file &quot;named.dns.com&quot;;　　　　//存放反向解析的配置文件名<br />allow-update &#123;none;&#125;;　　　　<br />&#125;;　</span><br /><br /><span style="color: blue"><br />zone &quot;dns.com&quot; IN &#123;<br />type master; // 如上<br />file &quot;dns.com.zone&quot;; //　如上，注意文件名的變化和後面的符號<br />allow-update &#123; none; &#125;;<br />&#125;;<br /></span><br />#include &quot;/etc/rndc.key&quot;;<br />＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝<br />下面我們去 /var/named目錄下完成對　named.dns.com and dns.com.zone的配置<br /><span style="color: red">The content of named.dns.com<br />$TTL 86400 // refresh time always is one day<br />@ IN SOA localhost. root.dns.com. (<br />1997022700 ; Serial<br />28800 ; Refresh<br />14400 ; Retry<br />3600000 ; Expire<br />86400 ) ; Minimum<br />IN NS www.dns.com. === defalut is www.dns.com<br />3 IN PTR mail.dns.com. === add mail.dns.conm<br />3 IN PTR www.dns.com. ===以下類同.....看清楚符號<br />3 IN PTR ftp.dns.com.<br /></span><br /><span style="color: blue"><br />$TTL 86400<br />$ORIGIN dns.com.<br />@ 1D IN SOA @ root (<br />42 ; serial (d. adams)<br />3H ; refresh<br />15M ; retry<br />1W ; expiry<br />1D ) ; minimum<br /><br />1D IN NS @<br /><br />www 1D IN A 192.168.0.3<br />mail 1D IN A 192.168.0.3<br />ftp 1D IN A 192.168.0.3<br />@ 1D IN A 192.168.0.3 === add default</span>
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?79</link>
<title><![CDATA[DNS服務器的配置]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Mon, 02 Apr 2007 17:16:13 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?79</guid> 
<description>
<![CDATA[ 
	<p>DNS服務器的配置&nbsp; </p><p>1、&nbsp; 安裝bind相關文件及caching-nameserver文件。如果不安裝caching-nameserver文件，則DNS服務的相關配置文件不存在。</p><p></p><p>2、&nbsp; 修改DNS主配置文件/etc/named.conf，添加以下內容：<br />1）在options內加入forwarders&#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //指明備用DNS服務器，即該DNS服務器<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 202.204.112.66;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //不能處理的域名則交給以下DNS服務。 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 202.204.112.67;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#125;;<br />如果DNS服務器開啟了防火牆，則應該將// query-source address * port 53;的//去除。<br /><br />2）zone &quot;linux.com&quot; IN &#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //指明DNS服務器配置的域為linux.com<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type master;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //該主機為主DNS服務器<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file &quot;named.test20.linux.com&quot;;&nbsp;&nbsp; //相應的正向解析文件<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow-update &#123; none; &#125;;<br />&#125;;</p><p></p><p>3）zone &quot;118.204.202.in-addr.arpa&quot; IN &#123;&nbsp;&nbsp;&nbsp;&nbsp; 指定202.204.118網段計算機的逆向域文件<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type master;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file &quot;named.test20.linux.com.rev&quot;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; allow-update &#123; none; &#125;;<br />&#125;;</p><p></p><p>3、&nbsp; 編輯正向解析文件(vi /var/named/ named.test20.linux.com)<br />&nbsp;&nbsp;&nbsp; @&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SOA&nbsp;&nbsp;&nbsp;&nbsp; test20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root.test20.linux.com. (<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2005060600;serial<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 28800;refresh<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7200;retry<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 604800;expire<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 86400;ttl<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test20&nbsp;&nbsp;&nbsp; //說明該DNS服務器的主機名為test20<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mail.linux.com.&nbsp; //指明郵件服務器</p><p></p><p>test20&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 202.204.118.20&nbsp; //指明test20.linux.com的IP為202.204.118.20<br />ftp&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 202.204.118.219&nbsp; //指明<a href="ftp://ftp.linux.com/">ftp.linux.com</a>的IP為202.204.118.219<br />www&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CNAME&nbsp;&nbsp; ftp&nbsp;&nbsp; //指明<a href="http://www.linux.com/">www.linux.com</a>的IP地址和<a href="ftp://ftp.linux.com/">ftp.linux.com</a>相同</p><p></p><p>第一行的test20為該DNS所在的主機名，最好與/etc/sysconfig/network文件中的HOSTNAME相同，如果該主機名是完整的域名，則必須以「.」結尾，否則在主機名後自動加上域，如這裡認為該主機的全域名為test20.linux.com。root.test20.linux.com.為管理員的EMAIL，等價於<a href="mailto:root@test20.linux.com">root@test20.linux.com</a>.。@為設置本地計算機的引用。</p><p></p><p>4、&nbsp; 編輯逆向解析文件（vi /var/named/named.test20.linux.com.rev）</p><p></p><p>@&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SOA&nbsp;&nbsp;&nbsp;&nbsp; test20&nbsp; root.test20.linux.com. (<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2005060600 ; serial<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 28800 ;refresh<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7200 ;retry<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 604800 ;expire<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 86400 ;ttl<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )</p><p></p><p>@&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test20.linux.com.&nbsp; //指明DNS服務器所在主機。</p><p></p><p>20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PTR&nbsp;&nbsp;&nbsp;&nbsp; test20.linux.com.&nbsp; //指明202.204.118.20為test20.linux.com.<br />20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PTR&nbsp;&nbsp;&nbsp;&nbsp; mail.linux.com.<br />219&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PTR&nbsp;&nbsp;&nbsp;&nbsp; <a href="ftp://ftp.linux.com/">ftp.linux.com</a>.&nbsp;&nbsp; //指明202.204.118.219為<a href="ftp://ftp.linux.com/">ftp.linux.com</a>.<br />219&nbsp;&nbsp;&nbsp;&nbsp; IN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PTR&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.linux.com/">www.linux.com</a>.</p><p></p><p>5、啟動named進程<br />使用命令：service named start/restart</p><p></p><p>6、設置DNS服務器為202.204.118.20（即DNS服務器所在主機的IP）並重啟網卡<br />如：修改/etc/resolv.conf文件；<br />&nbsp;&nbsp;&nbsp; 重啟網卡：service network restart</p><p></p><p>7、使用nslookupa或ping檢查是否配置成功<br />&nbsp;&nbsp;&nbsp; 輸入命令nslookup mail.linux.com<br />Server:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 202.204.118.20<br />Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 202.204.118.20#53</p><p></p><p>Name:&nbsp;&nbsp; mail.linux.com<br />Address: 202.204.118.20<br />&nbsp;&nbsp;&nbsp; 或輸入命令：nslookup 202.204.118.219<br />Server:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 202.204.118.20<br />Address:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 202.204.118.20#53</p><p></p><p>219.118.204.202.in-addr.arpa&nbsp;&nbsp;&nbsp; name = <a href="http://www.linux.com/">www.linux.com</a>.<br />219.118.204.202.in-addr.arpa&nbsp;&nbsp;&nbsp; name = <a href="ftp://ftp.linux.com/">ftp.linux.com</a>.<br />這就說明DNS服務器配置成功！！！！！！ <br />&nbsp;</p>
]]>
</description>
</item><item>
<link>http://www.xspace.idv.tw/bo_blog/read.php?78</link>
<title><![CDATA[BIND 9 的高級配置]]></title> 
<author>bruce_wu &lt;bruce@xspace.idv.tw&gt;</author>
<category><![CDATA[DNS 服務]]></category>
<pubDate>Mon, 02 Apr 2007 17:10:59 +0000</pubDate> 
<guid>http://www.xspace.idv.tw/bo_blog/read.php?78</guid> 
<description>
<![CDATA[ 
	<div id="art" style="margin: 15px"><div>本頁目錄<br />BIND 9 的高級配置<br />ACL<br />定義 ACL<br />使用 ACL<br />ACL 使用舉例<br />使用 View 分離內外服務器配置<br />關於分離內外服務器配置<br />View 語句<br />BIND 9 日誌<br />BIND 日誌的常用術語<br />logging 語句的語法<br />在 chroot jail 環境下運行 BIND 9<br />停止 bind 服務器的運行<br />創建 chroot jail 環境<br />修改 BIND 的默認啟動參數<br />添加 BIND 系統日誌路徑<br />重新啟動 bind9 和 sysklogdTags: ubuntu, dapper, netappsrv, bind, acl, view, logging, chroot </div><div>&laquo; sitemap<br />&laquo; dapper &laquo; netappsrv </div><div>BIND 9 的高級配置<br />內容提要</div><div><br />定義和使用訪問控制列表<br />使用 View 配置分離的內外服務器<br />BIND 9 的日誌配置<br />在 chroot jail 環境下運行 BIND 9<br />ACL<br />訪問控制列表（ACL）就是一個被命名的地址匹配列表。使用訪問控制列表可以使配置簡單而清晰，一次定義之後可以在多處使用，不會使配置文件因為大量的 IP 地址而變得混亂。 </div><div>定義 ACL<br />要定義訪問控制列表，可以在 BIND 的主配置文件 /etc/bind/named.conf 中使用 acl 語句來實現。acl 語句的語法為： </div><div>acl&nbsp; acl_name &#123;<br />&nbsp;&nbsp; address_match_list;<br />&#125;;<br />BIND 裡默認預定義了 4 個名稱的地址匹配列表，他們可以直接使用，分別為： </div><div>any : 所有主機<br />localhost : 本機<br />localnets : 本地網絡上的所有主機<br />none : 不匹配任何主機</div><div>acl 是 named.conf 中的頂級語句，不能將其嵌入其他的語句。<br />要使用用戶自己定義的訪問控制列表，必須在使用之前定義。因為可以在 options 語句裡使用訪問控制列表，所以定義訪問控制列表的 acl 語句應該位於 options 語句之前。<br />為了便於維護管理員定義的訪問控制列表，可以將所有定義 acl 的語句存放在單獨的文件 /etc/bind/named.conf.acls 中，然後在主配置文件 /etc/bind/named.conf 中如下語句 </div><div>include &quot;/etc/bind/named.conf.options&quot;;<br />之前添加如下的配置行 </div><div>include &quot;/etc/bind/named.conf.acls&quot;;</div><div><br />使用 ACL<br />定義了 ACL 之後，可以在如下的子句中使用 </div><div>子句&nbsp; 語句&nbsp; 說明&nbsp; <br />allow-query&nbsp; options,zone&nbsp; 指定哪主機或網絡可以查詢本服務器或區，默認的是允許所有主機進行查詢。&nbsp; <br />allow-transfer&nbsp; options,zone&nbsp; 指定哪些主機允許和本地服務器進行域傳輸，默認值是允許和所有主機進行域傳輸。&nbsp; <br />allow-recursion&nbsp; options&nbsp; 指定哪些主機可以進行遞歸查詢。如果沒有設定，缺省是允許所有主機進行遞歸查詢的。注意禁止一台主機的遞歸查詢，並不能阻止這台主機查詢已經存在於服務器緩存中的數據。 <br />allow-update&nbsp; zone&nbsp; 指定哪些主機允許為主域名服務器提交動態 DNS 更新。默認為拒絕任何主機進行更新。 <br />blackhole&nbsp; options&nbsp; 指定不接收來自哪些主機的查詢請求和地址解析。默認值是 none 。 </div><div>上面列出的一些配置子句既可以出現在全局配置 options 語句裡，又可以出現在 zone 聲明語句裡，當在兩處同時出現時，zone 聲明語句中的配置將會覆蓋全局配置 options 語句中的配置。 <br />ACL 使用舉例<br />限制查詢<br />假如要限制只有 202.0.0.0/8 和 221.0.0.0/8 查詢本地服務器的所有區信息，可以在 options 語句裡使用如下的 allow-query 子句 </div><div>options &#123;<br />......<br />allow-query &#123; 202.0.0.0/8; 221.0.0.0/8; &#125;;<br />......<br />&#125;; <br />上面的配置沒有使用 ACL，若使用 acl，需要以下的配置步驟： </div><div>S1 在 /etc/bind/named.conf.acls 中添加如下的 acl 語句，對允許查詢的主機列表命名 </div><div>acl aqlist &#123;<br />&nbsp; 202.0.0.0/8; <br />&nbsp; 221.0.0.0/8; <br />&#125;;<br />S2 在 /etc/bind/named.conf.options 中使用定義的 acl_name 限制允許查詢的主機列表 </div><div>options &#123;<br />......<br />allow-query &#123; aqlist; &#125;;<br />......<br />&#125;; <br />限制區傳輸<br />假如要限制只有 221.3.131.5 和 221.3.131.6 可以從本地服務器傳輸 「example.com」 的區信息，可以在 zone 語句裡使用如下的 allow-transfer 子句 </div><div>zone &quot;example.com&quot; &#123;<br />&nbsp;&nbsp; type master;<br />&nbsp;&nbsp; file &quot;example.com.hosts&quot;;<br />&nbsp;&nbsp; allow-transfer &#123; 221.3.131.5; 221.3.131.6; &#125;;<br />&#125;;<br />上面的配置沒有使用 ACL，若使用 acl，需要以下的配置步驟： </div><div>S1 在 /etc/bind/named.conf.acls 中添加如下的 acl 語句，對允許查詢的主機列表命名 </div><div>acl atlist &#123;<br />&nbsp; 221.3.131.5; <br />&nbsp; 221.3.131.6; <br />&#125;;<br />S2 在 /etc/bind/named.conf.local 中使用定義的 acl_name 限制允許進行域傳輸的主機列表 </div><div>zone &quot;example.com&quot; &#123;<br />&nbsp;&nbsp; type master;<br />&nbsp;&nbsp; file &quot;example.com.hosts&quot;;<br />&nbsp;&nbsp; allow-transfer &#123; atlist; &#125;;<br />&#125;;<br />防止欺騙和拒絕服務攻擊<br />為了防止欺騙和拒絕服務攻擊，對於 Internet 上的每個 DNS 服務器至少應該有一個假地址的 ACL 和一個本地地址的 ACL。為此，需要執行如下的步驟 </div><div>S1 在 /etc/bind/named.conf.acls 中添加如下的 acl 語句 </div><div>// 創建一個名稱為 &quot;bogusnets&quot; 的 ACL 來阻止經常用於欺騙性攻擊的（RFC1918）地址空間</div><div>acl bogusnets &#123;<br />&nbsp;&nbsp;&nbsp; 0.0.0.0/8; <br />&nbsp;&nbsp;&nbsp; 1.0.0.0/8;<br />&nbsp;&nbsp;&nbsp; 2.0.0.0/8;<br />&nbsp;&nbsp;&nbsp; 169.254.0.0/16;<br />&nbsp;&nbsp;&nbsp; 192.0.2.0/24;<br />&nbsp;&nbsp;&nbsp; 224.0.0.0/3;<br />&nbsp;&nbsp;&nbsp; 10.0.0.0/8;<br />&nbsp;&nbsp;&nbsp; 172.16.0.0/12;<br />&nbsp;&nbsp;&nbsp; 192.168.0.0/16;<br />&#125;;</div><div>//創建一個名稱為 &quot;our-nets&quot; 的 ACL，並將其配置為實際本網的 IP 地址段。</div><div>acl our-nets &#123;&nbsp;&nbsp;&nbsp; //用您的網絡地址替換下面的地址列表<br />&nbsp;&nbsp;&nbsp; x.x.x.x/24;<br />&nbsp;&nbsp;&nbsp; x.x.x.x/21; <br />&#125;; <br />S2 在 /etc/bind/named.conf.options 中使用定義的 acl_name 限制查詢和響應 </div><div>options &#123;<br />......<br />allow-query &#123; our-nets; &#125;;<br />allow-recursion &#123; our-nets; &#125;;<br />blackhole &#123; bogusnets; &#125;;<br />......<br />&#125;; <br />使用 View 分離內外服務器配置<br />關於分離內外服務器配置<br />許多站點希望 DNS 對於內網訪問和外網（Internet）訪問看起來不一樣，這種類型的配置稱為「分離 DNS （Split DNS）」。 </div><div>這種配置可以用於如下的情況： </div><div>對內網用戶公開整個區的所有主機；對 Internet 用戶只公開幾台主機，如 www 服務器等<br />對內外用戶指定不同的 RR，或對內網用戶提供更多的 RR<br />可以在內網使用 RFC 1918 中定義的私有地址 <br />View 語句<br />在 BIND 9 中可以使用 view 語句進行配置分離 DNS 。 view 語句的語法為 </div><div>view view_name &#123;<br />&nbsp;&nbsp;&nbsp;&nbsp; match-clients &#123; address_match_list &#125;;<br />&nbsp;&nbsp;&nbsp;&nbsp; [ view_option; ...]<br />&nbsp;&nbsp;&nbsp;&nbsp; zone_statement; ...<br />&#125;;<br />其中： </div><div>match-clients 子句非常重要，它用於指定誰能看到本 view。<br />可以在 view 語句中使用一些選項，詳細信息請參考 named.conf 的手冊頁<br />zone_statement 子句指定在當前 view 中可見的區聲明 </div><div>如果在配置文件中使用了 view 語句，則所有的 zone 語句都必須在 view 中出現。<br />對同一個 zone 而言，配置內網的 view 應該置於外網的 view 之前。 </div><div>下面是一個使用 view 語句的例子，它摘自 BIND9 的文檔。 </div><div>view&nbsp; &quot;internal&quot; &#123;<br />&nbsp;&nbsp; match-clients &#123; our-nets; &#125;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 匹配內網客戶的訪問<br />&nbsp;&nbsp; recursion yes;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 對內網客戶允許執行遞歸查詢<br />&nbsp;&nbsp; zone &quot;example.com&quot; &#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 定義內網客戶可見的區聲明<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type master;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file &quot;example.com.hosts.internal&quot;;<br />&nbsp;&nbsp; &#125;;<br />&#125;;</div><div>view&nbsp; &quot;external&quot; &#123;<br />&nbsp;&nbsp; match-clients &#123; any; &#125;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 匹配 Internet 客戶的訪問<br />&nbsp;&nbsp; recursion no;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 對 Internet 客戶不允許執行遞歸查詢<br />&nbsp;&nbsp; zone &quot;example.com&quot; &#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 定義 Internet 客戶可見的區聲明<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type master;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file &quot;example.com.hosts.external&quot;;<br />&nbsp;&nbsp; &#125;;<br />&#125;;<br />接下來，需要在 example.com.hosts.internal 中創建內網客戶可見的區文件，並在 example.com.hosts.external 中創建 Internet 客戶可見的區文件。可以根據您的實際情況編寫這兩個文件，此處從略。 </div><div>BIND 9 日誌<br />在默認情況下，BIND9 把日誌消息寫到 /var/log/messages 文件中，而這些日誌消息是非常少的，主要就是啟動，關閉的日誌記錄和一些嚴重錯誤的消息；而將調試日誌信息寫入 BIND 服務器工作目錄中的 named.run 文件。 </div><div>BIND 9 的日誌是可以靈活配置的，要詳細記錄服務器的運行狀況，要在配置文件 named.conf 中使用 logging 語句來定制自己所需要的日誌記錄。 </div><div>BIND 日誌的常用術語<br />在講述 logging 語句的語法之前，先要熟悉一些常用術語 </div><div>術語&nbsp; 含義&nbsp; <br />channel（通道）&nbsp; 日誌輸出方式，如：syslog、文本文件、標準錯誤輸出或 /dev/null&nbsp; <br />category（類別）&nbsp; 日誌的消息類別，如：查詢消息或動態更新消息等&nbsp; <br />module（模塊）&nbsp; 產生消息的來源模塊名稱&nbsp; <br />facility（設備）&nbsp; syslog 設備名&nbsp; <br />severity（嚴重性）&nbsp; 消息的嚴重性等級&nbsp; </div><div><br />logging 語句的語法<br />logging 語句的語法為： </div><div>logging &#123;<br />&nbsp;&nbsp;&nbsp; channel channel_name &#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 定義通道<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file log_file [versions number &#124; unlimited] [size sizespec]; &#124; syslog optional_facility; &#124; null; &#124; stderr;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 定義輸出方式<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; severity log_severity;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 定義消息嚴重性<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [print-time boolean;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 是否在消息中添加時間前綴，僅用於 file 日誌<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [print-severity boolean;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 是否在消息中添加消息嚴重性前綴<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [print-category boolean;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 是否在消息中添加消息類別名前綴<br />&nbsp;&nbsp; &#125;;<br />&nbsp;&nbsp; category category_name &#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 定義類別<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; channel_name;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...... <br />&nbsp;&nbsp; &#125;;<br />&#125;;<br />配置日誌時，首先要定義通道，然後將不同的日誌類別的數據指派到指定的通道上輸出。 </div><div>BIND 9 的默認配置是： </div><div>logging &#123;<br />&nbsp;&nbsp;&nbsp; // 由於使用了默認通道，所以沒有通道定義部分<br />&nbsp;&nbsp;&nbsp; category &quot;default&quot; &#123; &quot;default_syslog&quot;; &quot;default_debug&quot;; &#125;;&nbsp; <br />&#125;; <br />channel 語句<br />channel 語句用於定義通道。 </div><div>指定應該向哪裡發送日誌數據，需要在以下四種之間則其一：<br />file : 輸出到純文本文件<br />log_file 指定一個文件名<br />version 指定允許同時存在多少個版本的該文件，比如指定 3 個版本（version 3），就會保存 query.log、query.log0、query.log1 和query.log2。<br />size 指定文件大小的上限，如果只設定了size 而沒有設定 version，當文件達到指定的文件大小上限時，服務器停止寫入該文件。如果設定了version，服務器會進行循環，如把 log_file 變成 log_file.log1，log_file.log1 變成 log_file.log2 等，然後建立一個新的 log_file.log 進行寫入。<br />syslog optional_facility ：輸出到 syslog，其中 optional_facility 是 syslog 的設備名，通常為以下幾個<br />daemon<br />local0 到 local7<br />null ：輸出到空設備<br />stderr ：輸出到標準錯誤輸出，默認為屏幕<br />severity 語句用於指定消息的嚴重性等級， log_severity 的取值為（按照嚴重性遞減的順序）：<br />critical<br />error<br />warning<br />notice<br />info<br />debug [ level ]<br />dynamic 是一個特殊的值，它匹配服務器當前的調試級別</div><div>定義了某個嚴重性級別後，系統會記錄包括該級別以及比該級別更嚴重的級別的所有消息。比如定義級別為 error，則會記錄 critical 和error 兩個級別的信息。<br />對於系統管理員來說，一般記錄到 info 級別就可以了。</div><div>BIND 9 預制了如下四個默認通道； </div><div>channel &quot;default_syslog&quot; &#123;<br />&nbsp;syslog daemon; &nbsp;&nbsp;&nbsp; // 發送給 syslog 的 daemon 設備<br />&nbsp;severity info; &nbsp;&nbsp;&nbsp; // 只發送此 info 及其更高優先級的信息<br />&#125;; &nbsp;&nbsp;</div><div>channel &quot;default_debug&quot; &#123; // 只有當服務器的 debug 級別非 0 時，才產生輸出。<br />&nbsp;file &quot;named.run&quot;; // 寫入工作目錄下的 named.run 文件<br />&nbsp;severity dynamic; // 按照服務器當前的debug 級別記錄日誌<br />&#125;;</div><div>channel &quot;default_stderr&quot; &#123; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stderr;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 寫到stderr<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; severity info;&nbsp;&nbsp;&nbsp; // 只發送此 info 及其更高優先級的信息</div><div>&#125;; </div><div>channel &quot;null&quot; &#123; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; null;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 丟棄所有發到此通道的信息<br />&#125;;<br />category 語句<br />category 語句是指定哪一種類別的信息使用哪個或者哪幾個已經定義了的通道輸出。 </div><div>BIND 9 中可用的類別名（category_name）有： </div><div>類別&nbsp; 說明&nbsp; <br />client&nbsp; 處理客戶端請求。&nbsp; <br />config&nbsp; 配置文件分析和處理。&nbsp; <br />database 同BIND內部數據庫相關的消息，用來存儲區數據和緩存記錄。&nbsp; <br />default&nbsp; 匹配所有未明確指定通道的類別。&nbsp; <br />dnssec&nbsp; 處理 DNSSEC 簽名的響應。&nbsp; <br />general&nbsp; 包括所有未明確分類的 BIND 消息。&nbsp; <br />lame-servers 發現錯誤授權，即殘缺服務器。&nbsp; <br />network&nbsp; 網絡操作。&nbsp; <br />notify&nbsp; 區更新通知消息。&nbsp; <br />queries 查詢日誌&nbsp; <br />resolver 名字解析，包括對來自解析器的遞歸查詢信息。&nbsp; <br />security 批准/非批准的請求。&nbsp; <br />update&nbsp; 動態更新事件。&nbsp; <br />xfer-in&nbsp; 從遠程名字服務器到本地名字服務器的區傳送。&nbsp; <br />xfer-out 從本地名字服務器到遠程名字服務器的區傳送。&nbsp; </div><div><br />例如要記錄查詢消息，可以在 named.conf 中添加如下配置： </div><div>logging &#123;<br />&nbsp;&nbsp;&nbsp; channel query_log &#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file &quot;query.log&quot; versions 3 size 20m;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; severity info;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print-time yes;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print-category yes;<br />&nbsp;&nbsp;&nbsp; &#125;;<br />&nbsp;&nbsp;&nbsp; category queries &#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; query_log;<br />&nbsp;&nbsp;&nbsp; &#125;;<br />&#125;;<br />這樣服務器會在工作目錄（directory 語句所指定的目錄，Ubuntu 為：/var/cache/bind）下創建 query.log 文件，並把運行過程產生的 queries 消息寫如到此文件中。 </div><div>一般地，當 BIND 做了重大修改後，應該配置並監視日誌，可能還要提高日誌消息級別，一旦穩定後便可以還原配置。因為日誌會佔用大量的磁盤空間，尤其是查詢日誌。 <br />在 chroot jail 環境下運行 BIND 9<br />基於安全的考慮，應該在 chroot jail 環境下運行 BIND 9 。下面講述將 BIND 9 運行在 /chroot/named jail 環境中的配置步驟。 </div><div>停止 bind 服務器的運行<br />sudo /etc/init.d/bind9 stop創建 chroot jail 環境<br />創建 chroot 目錄<br />sudo mkdir -p /chroot/named<br />sudo chmod -R 700 /chroot<br />sudo mkdir /chroot/named/etc <br />sudo mkdir /chroot/named/dev<br />sudo mkdir -p /chroot/named/var/cache/bind<br />sudo mkdir -p /chroot/named/var/run/bind/run<br />移動原始的 /etc/bind 目錄到 /chroot/named/etc<br />sudo mv /etc/bind /chroot/named/etc<br />sudo ln -s /chroot/named/etc/bind /etc/bind&nbsp; // 為原位置創建符號鏈接，以便將來更新 <br />創建設備並修改權限<br />sudo mknod /chroot/named/dev/null c 1 3<br />sudo mknod /chroot/named/dev/random c 1 8<br />sudo chmod 666 /chroot/named/dev/null <br />sudo chmod 666 /chroot/named/dev/random<br />sudo chown -R bind:bind /chroot/named/var/*<br />sudo chown -R bind:bind /chroot/named/etc/bind<br />修改 BIND 的默認啟動參數<br />使用如下命令修改 /etc/default/bind9 </div><div>sudo vi /etc/default/bind9將如下的行 </div><div>OPTIONS=&quot;-u bind&quot;改為 </div><div>OPTIONS=&quot;-u bind -t /chroot/named&quot;添加 BIND 系統日誌路徑<br />使用如下命令修改 /etc/init.d/sysklogd </div><div>sudo vi /etc/init.d/sysklogd將如下的行 </div><div>SYSLOGD=&quot;-u syslog&quot;改為 </div><div>SYSLOGD=&quot;-u syslog -a /chroot/named/dev/log&quot;重新啟動 bind9 和 sysklogd<br />sudo /etc/init.d/sysklogd restart<br />sudo /etc/init.d/bind9 start<br />進一步閱讀</div><div>全面提升BIND DNS服務器安全（上）<br />全面提升BIND DNS服務器安全（下）</div></div>
]]>
</description>
</item>
</channel>
</rss>