2011年12月26日 星期一

安裝、檢視 DNS

安裝 DNS
$sudo apt-get install bind9

安裝完畢後
$netstat -an

會看見 udp 53tcp 53 這兩個 port 已經開啟


檢視 DNS
$nslookup
>server

檢視我們的 DNS server 是哪台

詢問 DNS
$nslookup
>set type=soa                --資料的型態
>edu.tw.                          --向 DNS 詢問 edu.tw. 的資料


檢視 Cache  ( DNS 暫存檔 )
$sudo rndc dumpdb -cache                           --將 cache 輸出至檔案
$nl /var/cache/bind/named_dump.db            --檢視輸出檔

裡面可以看到電腦名稱、資料存活時間、型態、IP或網址


清除 cache
$sudo rndc flush

當重新設定完 DNS 後,舊的資料還存留在 cache 中,所以要清除 cache ,讓資料重新抓取

沒有留言:

張貼留言