顯示具有 DNS 標籤的文章。 顯示所有文章
顯示具有 DNS 標籤的文章。 顯示所有文章

2011年2月1日

DNS Slave 資料不同步時不會回應

今天發現,Bind9的slave service突然不會回應我的request
找了很久,原來是因為資料不同步的關係,重新同步後一整
個就正常了

2010年4月26日

如何建立 rndc 管理 bind 9

Bind 9 之後提供 "rndc" (remote name daemon control),它可使系統管理者利用 rndc command遠端或本端(localhost)控制管理Bind,並以加密方式來傳送資料,以防止其他非授權使用者控制Bind,作法如下:

//產生 rndc.conf
shell># rndc-confgen > /etc/rndc.conf

//執行 "rndc-confgen > /etc/rndc.conf" 後,會產生 /etc/rndc.conf 檔,內容如下:
# Start of rndc.conf
key "rndckey" {
algorithm hmac-md5;
secret "VRg7SR9B2rvTeLPcPSfCPA==";
};

options {
default-key "rndckey";
default-server 127.0.0.1;
default-port 953;
};
# End of rndc.conf

# Use with the following in named.conf, adjusting the allow list as needed:

# key "rndckey" {
# algorithm hmac-md5;
# secret "VRg7SR9B2rvTeLPcPSfCPA==";
# };
#
# controls {
# inet 127.0.0.1 port 953
# allow { 127.0.0.1; } keys { "rndckey"; };
# };

# End of named.conf


將 rndc.conf 裡有關 named.conf 的資料(上方的藍色文字區)貼到 /etc/named.conf ,記得要把註解拿掉,重新啟動 named 服務,就可以開始使用 rndc 的功能了。

參考文獻
man rndc
twnic BIND介紹與安裝 > rndc

2010年4月25日

用 bind 9 建立 caching-only name server

caching-only name server 顧名思義就是將查詢的結果暫存起來,未來有其他的 client 問到相同的名稱時,可以直接從暫存回覆 client,而不用在一層一層的問下來。

範例:
//定義 mynets 的網段。
acl mynets { 192.168.4.0/24; 192.168.7.0/24; };

//利用 allow-query 參數我要限定只有我所屬的網段可以透過 DNS Server 查詢。
options {
directory "/etc/namedb"; // Working directory
allow-query { mynets; };
};

// Provide a reverse mapping for the loopback address 127.0.0.1
zone "0.0.127.in-addr.arpa" {
type master;
file "localhost.rev";
notify no;
};

that's it!

//2010/04/25 update

若你是使用 RHEL 或 CentOS 可以安裝 caching-nameserver 套件,只要將 /etc/named.caching-nameserver.conf 改名為 /etc/named.conf,再稍微設定一下,啟動 named 服務就可以完成caching-only name server 了。