|
Domain Name System (DNS)
張貼日期 2010/3/21 23:52:22
作者 lutuni
|
Environment (環境)
Operation-System:Ubuntu Server 8.041 Deb:bind9 (DNS)
jonny@ubuntu:~$ sudo apt-get install bind9
Hinet 網域註冊:
DNS Server Name:www.etype.idv.tw IP Address:123.204.51.114
DNS Server Name:dns.etype.idv.tw IP Address:123.204.51.114
Server Configure (伺服器設定)
1. 加入正反解設定:named.conf 會指出 Server 管轄的區域(Zone)名稱及相關檔案。於 include "/etc/bind/named.conf.local"; 上方加入預新增的設定
jonny@ubuntu:~$ sudo vim /etc/bind/named.conf ... //增加正解區域(Zone) zone "etype.idv.tw" { type master; file "/etc/bind/db.etype"; };
//增加反解區域(Zone) zone "51.204.123.in-addr.arpa" { type master; file "/etc/bind/db.51.204.123"; };
include "/etc/bind/named.conf.local";
2. 修改 Bind 參數
1. 備份原始參數
jonny@ubuntu:/etc/bind$ sudo cp named.conf.options named.conf.options.bak
2. 更新參數
jonny@ubuntu:/etc/bind$ sudo vim named,conf.options options { directory "/var/cache/bind"; forwarders { 168.95.1.1; 139.175.10.20; 203.133.1.6; }; allow-query { any; }; allow-transfer { none; }; };
3. 建立正解區域設定檔
jonny@ubuntu:/etc/bind$ sudo vim db.etype ; BIND reverse data file for local loopback interface
$TTL 604800 @ IN SOA etype.idv.tw. dns.etype.idv.tw. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS dns.etype.idv.tw. @ IN NS www.etype.idv.tw. @ IN MX 10 123.204.51.114 @ IN A 123.204.51.114 www IN A 123.204.51.114
4. 3. 建立反解區域設定檔
jonny@ubuntu:/etc/bind$ sudo vim db.51.204.123 ; BIND reverse data file for local loopback interface
$TTL 604800 @ IN SOA @ root.dns.etype.idv.tw. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS dns.etype.idv.tw. @ IN NS www.etype.idv.tw. 114 IN PTR dns.etype.idv.tw. 114 IN PTR www.etype.idv.tw.
5. 重開 DNS Server
jonny@ubuntu:~$ sudo /etc/init.d/bind9 restart [sudo] password for jonny: * Stopping domain name service... bind [ OK ] * Starting domain name service... bind [ OK ]
|
|