Filed Under (Note) by a-wei on 30-07-2007

私人單位的 DNS 就不需要那麼慷慨的讓別人透過自己的 DNS Server 去做名稱解析的動作。 很多無聊人士,就是透過這種查詢的方式,去癱瘓 DNS Server.

不想要別人透過自己的機器查詢,但讓自己人查詢總可以吧!

編輯 /etc/named.conf

建立 acl (access control list)

在檔案的最上方,加入下列兩行 ..

acl “trusted1″ { 127.0.0.1; };
acl “trusted2″ { 192.168.1.0/24;};

在 options 的地方加入 allow-recursion ..

options {

allow-recursion { trusted1; trusted2; };
};

之後在 service named restart. 設定即完成。

會分成兩個的主因在於, 把 特定 ip 跟 特定的 subnet 區分開來,因為當初寫在一起實,這個設定並不 work. 拆來就正常了。



Post a comment

Name: 
Email: 
URL: 
Comments: