Lorenzo 撰寫於文章 <827u0l$aod@netnews.hinet.net>...
>各位先進大家好 :
>我希望將 happy.com.tw 這個網域設定在 Linux 的 DNS 中 ,
>Linux 的主機名稱是 rh , ip 是 203.149.158.1 ,
>還有一個 Web Server , IP 是 203.149.158.2
>
>請問我要怎麼設定 ? Please help me !!
>
>

1, 修改 /etc/named.conf :

// Boot file for happy.com.tw name server

options {
        directory "/var/named";
};

zone "." {
        type hint;
        file "root.hints";
};

zone "0.0.127.in-addr.arpa" {
        type master;
        file "named.local";
};

zone "158.149.203.in-addr.arpa" {
        type master;
        file "named.203.149.158";
};

zone "happy.com.tw." {
        type master;
        file "named.happy.com.tw";
};


2﹐ 修改 /var/named/named.203.149.158 :

@               IN      SOA     rh.happy.com.tw. root.rh.happy.com.tw. (
                                19990120301       ; Serial
                                28800   ; Refresh
                                7200    ; Retry
                                604800  ; Expire
                                86400)  ; Minimum TTL
                        NS      rh.happy.com.tw.
1     PTR     rh.happy.com.tw.
2     PTR     www.happy.com.tw.

3﹐修改 /var/named/named.happy.com.tw :

@               IN      SOA     rh.happy.com.tw. root.rh.happy.com.tw. (
                                19990120301       ; Serial
                                28800   ; Refresh
                                7200    ; Retry
                                604800  ; Expire
                                86400)  ; Minimum TTL
                        NS      rh.happy.com.tw.

localhost       A       127.0.0.1

rh.happy.com.tw.        A       203.149.158.1
www.happy.com.tw.     A       203.149.158.2

4, 重新啟動 named :

ndc restart


(如果要設定有子網的 DNS﹐歡迎到 http://go.to/study-area 之 "學習 Linux" 那裡
看看)