close
網路環境
域名: test.com
主機名: linux
完整主機名稱: linux.test.com
IP網段: 192.168.0.X
安裝 bind*, system-config*, caching-nameserver。
完成後,啟動該服務, service named start 或 /etc/init.d/named start
(安裝完成後可直接安裝webmin 直接設定 DNS , http://www.webmin.com 直接下載RPM檔,點兩下安裝,安裝完成後 http://IP:10000 登入)
編輯主要設定檔 /etc/named.conf
[root@linux ~]# vi /etc/named.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
pid-file "/var/run/named/named.pid";
forwarders { 168.95.1.1; 139.175.10.20; };
allow-query { any; }; // 是否允許被查詢?
allow-transfer { none; }; // 是否允許傳送 zone ,預設不可
};
// 關於 DNS 伺服器的一些加密資料
include "/etc/rndc.key";
// 關於 root (.) 的設定
zone "." {
type hint; // 特殊的類別!專給 root (.) 用的
file "named.root"; // 檔名的定義
};
// 本機 localhost 的正反解
zone "localhost" {
type master;
file "named.localhost";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "named.127.0.0";
};
// 規範出 test.com 領域名
zone "test.com" {
type master;
file "named.test.com";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "named.192.168.1";
};
確定服務啟動與否
[root@linux ~]# netstat -utln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.254:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN
udp 0 0 192.168.1.254:53 0.0.0.0:*
udp 0 0 127.0.0.1:53 0.0.0.0:*
全站熱搜