DNS服務(wù)器配置實例 |
發(fā)布時間: 2012/5/29 18:01:44 |
配置DNS的實例: 1 所需配置文件: /etc/named.conf 系統(tǒng)自帶,需要配置 /etc/resolv.conf 系統(tǒng)自帶,需要配置 /var/named/myqmail.com.db 系統(tǒng)沒有,自已創(chuàng)建 /var/named/db.192.168.0.198 系統(tǒng)沒有,自已創(chuàng)建 /var/named/named.local 系統(tǒng)自帶,不需要修改 /var/named/named.ca 系統(tǒng)自帶,不需要修改 2 相關(guān)工具 nslookup 說明:檢測DNS是否配置正確的工具,系統(tǒng)自帶。 3 配置方案 3.1 /etc/named.conf 說明:DNS主配置文件,定義了域數(shù)據(jù)庫信息的基本參數(shù)和源點,該文件可以存放在本地或遠程的億恩科技服務(wù)器上。源文件: // generated by named-bootconf.pl options { directory "/var/named"; /* * If there is a firewall between you and nameservers you want * to talk to, you might need to uncomment the query-source * directive below. Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default. */ // query-source address * port 53; }; // // a caching only nameserver config // controls { inet 127.0.0.1 allow { localhost; } keys { rndckey; }; }; zone "." IN { type hint; file "named.ca"; }; zone "localhost" IN { type master; file "localhost.zone"; allow-update { none; }; }; zone "0.0.127.in-addr.arpa" IN { type master; file "named.local"; allow-update { none; }; }; zone "myqmail.com" IN { type master; file "myqmail.com.db"; allow-update { none;}; }; zone "0.168.192.in-addr.arpa" IN{ type master; file "db.192.168.0.198"; allow-update { none;}; }; include "/etc/rndc.key"; 3.2 /var/named/myqmail.com.db 說明:正向解析配置文件,即實現(xiàn)域名注冊到IP的對應(yīng)。源文件: $TTL 86400 @ IN SOA www.myqmail.com. myqmail.com. ( 2002103000 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS www.myqmail.com. localhost IN A 127.0.0.1 www IN A 192.168.0.198 3.3 /var/named/db.192.168.0.198 說明:DNS反向解析配置文件,即實現(xiàn)IP地址很域名注冊的映射。源文件: $TTL 86400 @ IN SOA www.myqmail.com. myqmail.com. ( 2002103000 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS www.myqmail.com. 198 IN PTR www.myqmail.com. 3.4 /etc/resolv.conf 說明:指定域名注冊億恩科技服務(wù)器的IP和搜索順序。源文件: search myqmail.com nameserver 192.168.0.198 4 測試及管理辦法 4.1 測試方法 1. 修改完DNS的配置文件,需要執(zhí)行/etc/rc.d/init.d/named restart來使更改生效。 2. nslookup:測試正向、反向的解析是否正常 5 小結(jié) DNS服務(wù)是許多服務(wù)的基礎(chǔ),所以我剛開始linux億恩科技服務(wù)器時,就著手配置DNS億恩科技服務(wù)器。DNS是用在局域網(wǎng)中,不連接Internet,僅僅限于局域網(wǎng)中為各個部門的各億恩科技主機及億恩科技服務(wù)器作解析用。 本文出自:億恩科技【1tcdy.com】 服務(wù)器租用/服務(wù)器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM] |