因為裝的是 Ubuntu 8.04 LTS Desktop 32-bit版本,所以得手動加入 DNS Server功能 ....

  1. 啟動選單 【系統】→【管理】→【Synaptic套件管理程式】
  2. 點選【搜尋】按鈕並輸入【bind】尋找BIND DNS Server 套件,並勾選 【bind9】及【bind9-doc】(如果需要說明文件的話)



    然後點選【套用】將bind安裝到系統中,安裝完後 /etc下將會多出 bind 目錄。
  3. 以文書編輯器開啟 /etc/bind/named.conf 加入你的網域資料,例如你的網域名稱為 abc.com.tw 則加入

    zone "abc.com.tw" in
    {
          type master;
          file "/etc/bind/abc.com.tw.zone";
    };

    其中,abc.com.tw.zone 就是你的 DNS 定義檔。
  4. DNS 定義檔的設定格式為:

    $TTL    604800
    @   IN SOA www.wenxuann.cn. root.wenxuann.cn. (
                      1     ; Serial
                604800     ; Refresh
                86400     ; Retry
                2419200     ; Expire
                604800 )   ; Negative Cache TTL
    ;
    @   IN NS www.wenxuann.cn.
    8   IN PTR www.wenxuann.cn.             //反向解析
    9   IN PTR www3.wenxuann.cn.

  5. 啟動 bind DNS Server ... /etc/init.d/bind9 start
  6. 停止 bind DNS Server ... /etc/init.d/bind9 stop
  7. 重新啟動 bind DNS Server ... /etc/init.d/bind9 restart
  8. 測試 DNS Server

    nslookup 【Enter】
    >server 192.168.2.130 【Enter】
    Default server: 192.168.2.130
    Address: 192.168.2.130#53
    指定要使用的 DNS 主機位置,當然就是你所架設的 bind DNS Server 所在的 IP 囉

    >abc.com.tw 【Enter】
    Server:        192.168.2.130
    Address:    192.168.2.130#53

    Name:    anc.com.tw
    Address: xx.xxx.xx.xx
    查詢 DNS 定義檔中有定義的 Domain Name 看看 bind DNS Server 是否運作正常。

相關閱讀:BIND9 DNS Server also-notify 失敗的解決
文章標籤
全站熱搜
創作者介紹
創作者 alvinhyc 的頭像
alvinhyc

阿達麵@軟硬語

alvinhyc 發表在 痞客邦 留言(0) 人氣(228)