2013-03-10 32 views
1

我想在我的測試環境中創建一個DNS服務器,但我不知道綁定。我的服務器中的設置是在谷歌搜索結果中創建的。該綁定開始沒有錯誤,但不解決我的域名。我試圖創建一個域名:lunarinterativa.labs用於我的解決方案。DNS debian SERVFAIL服務器找不到,沒有ping

我收到此錯誤:

server can't find www.lunarinterativa.labs.lunarinterativa.labs: SERVFAIL 
當我執行以下命令

nslookup 
> server interativa32 
Default server: interativa32 
Address: 172.224.116.100#53 
> www.lunarinterativa.labs 
Server:   interativa32 
Address:  172.224.116.100#53 

我的內部netwotk設置爲:

ip address: 172.224.116.100 
netmask: 255.255.255.0 
gateway: 172.224.116.254 

我ping命令interativa32.lunarinterativa。實驗室:好的

PING interativa32.lunarinterativa.labs (172.224.116.100) 56(84) bytes of data.64 bytes from interativa32.lunarinterativa.labs (172.224.116.100): icmp_req=1 ttl=64 time=0.049 ms 

我ping命令www.interativa32.lunarinterativa.labs:是錯誤

ping: unknown host www.interativa32.lunarinterativa.labs 

這是設置文件從我的域名的內容(文件:/etc/bind/db.lunarinterativa.labs) :

; ------------------------------------------------------------------- 
; Created by Lunar Interativa Scripts 
; type: Bind9 
; author: Sileno de Oliveira Brito 
; since: 09 Mar 2013 
; created: 10 Mar 2013 
; domain: lunarinterativa.labs 
; ip address: 172.224.116.100 
; hostname: interativa32 
; ------------------------------------------------------------------- 
$TTL 604800 
@  IN  SOA  interativa32.lunarinterativa.labs.  root.interativa32.lunarinterativa.labs. (
         2004111700 ; Serial 
         604800   ; Refresh 
         86400   ; Retry 
         2419200  ; Expire 
         604800) ; Negative Cache TTL 
; 
@  IN  A        172.224.116.100 

interativa32   IN  A  172.224.116.100 
www      IN  CNAME @ 
ftp      IN  CNAME @ 
repo     IN  CNAME @ 
ns1      IN  CNAME @ 

這是從我的反向域名設置文件的內容(文件:/etc/bind/db.lunarinterativa.labs):

; ------------------------------------------------------------------- 
; Created by Lunar Interativa Scripts 
; type: Bind9 Reverse 
; author: Sileno de Oliveira Brito 
; since: 09 Mar 2013 
; created: 10 Mar 2013 
; domain: lunarinterativa.labs 
; reverse: 116.224.172.in-addr.arpa 
; ip address: 172.224.116.100 
; hostname: interativa32 
; ------------------------------------------------------------------- 
@  IN  SOA  interativa32.lunarinterativa.labs.  root.interativa32.lunarinterativa.labs. (
         2004111700 ; Serial 
         604800   ; Refresh 
         86400   ; Retry 
         2419200  ; Expire 
         604800) ; Negative Cache TTL 
@  IN  NS        ns.lunarinterativa.labs. 
@  IN  A        172.224.116.100 
100  IN  PTR  interativa32.lunarinterativa.labs 

這是/etc/bind/named.conf.local

zone "116.224.172.in-addr.arpa" { 
     type master; 
     file "/etc/bind/db.116.224.172.in-addr.arpa"; 
}; 
zone "lunarinterativa.labs" { 
     type master; 
     file "/etc/bind/db.lunarinterativa.labs"; 
}; 

入門這是我的/etc/resolv.conf

domain lunarinterativa.labs 
search lunarinterativa.labs 
nameserver 127.0.0.1 

這是我的/ etc/hosts文件

127.0.0.1  localhost 
172.224.116.100 interativa32.lunarinterativa.labs  interativa32 

# The following lines are desirable for IPv6 capable hosts 
::1  ip6-localhost ip6-loopback 
fe00::0 ip6-localnet 
ff00::0 ip6-mcastprefix 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 

這是我/etc/bind/named.conf.options

options { 
     directory "/var/cache/bind"; 

     // If there is a firewall between you and nameservers you want 
     // to talk to, you may need to fix the firewall to allow multiple 
     // ports to talk. See http://www.kb.cert.org/vuls/id/800113 

     // If your ISP provided one or more IP addresses for stable 
     // nameservers, you probably want to use them as forwarders. 
     // Uncomment the following block, and insert the addresses replacing 
     // the all-0's placeholder. 

     forwarders { 
       8.8.8.8; 
     //  0.0.0.0; 
       172.224.116.254; 
     }; 

     auth-nxdomain no; # conform to RFC1035 
     listen-on port 53 { 127.0.0.1; 172.224.116.100; }; 
     allow-query { 127.0.0.1; 172.224.116.0/24; }; 
     allow-recursion { 127.0.0.1; 172.224.116.0/24; }; 
     allow-transfer { none; }; 

     listen-on-v6 { any; }; 

回答

0

錯誤是在我的配置文件中,我發現在腳本中看到我的錯誤。

這是設置文件從我的域名正確的內容(文件:/etc/bind/db.lunarinterativa.labs):

; ------------------------------------------------------------------- 
; Created by Lunar Interativa Scripts 
; type: Bind9 
; author: Sileno de Oliveira Brito 
; credit: OLIVEIRA , Willian:CONFIGURAÃO APACHE E DNS (BIND). Viva o Linux, Disponíl em: http://www.vivaolinux.com.br/script/Configuracao-Apache-e-DNS-(bind), Acesso em 10/03/2012 à20h 00min 
; since: 09 Mar 2013 
; created: 10 Mar 2013 
; domain: labs.lunarinterativa 
; ip address: 172.224.116.100 
; hostname: interativa32 
; ------------------------------------------------------------------- 
$TTL 604800 
@  IN  SOA  labs.lunarinterativa. root.labs.lunarinterativa. (
         2004111700 ; Serial 
         604800   ; Refresh 
         86400   ; Retry 
         2419200  ; Expire 
         604800) ; Negative Cache TTL 
; 
@  IN  NS        labs.lunarinterativa. 
@  IN  A        172.224.116.100 

interativa32   IN  A  172.224.116.100 
www      IN  CNAME interativa32.labs.lunarinterativa. 
ftp      IN  CNAME interativa32.labs.lunarinterativa. 
repo     IN  CNAME interativa32.labs.lunarinterativa. 
ns1      IN  CNAME interativa32.labs.lunarinterativa. 

這是設置文件從我的反向正確的內容域(文件:/etc/bind/db.lunarinterativa.labs):

; ------------------------------------------------------------------- 
; Created by Lunar Interativa Scripts 
; type: Bind9 Reverse 
; author: Sileno de Oliveira Brito 
; since: 09 Mar 2013 
; created: 10 Mar 2013 
; domain: labs.lunarinterativa 
; reverse: 116.224.172.in-addr.arpa 
; ip address: 172.224.116.100 
; hostname: interativa32 
; ------------------------------------------------------------------- 
@  IN  SOA  labs.lunarinterativa. root.labs.lunarinterativa. (
         2004111700 ; Serial 
         604800   ; Refresh 
         86400   ; Retry 
         2419200  ; Expire 
         604800) ; Negative Cache TTL 
@  IN  NS        labs.lunarinterativa. 
@  IN  A        172.224.116.100 
100  IN  PTR  interativa32.labs.lunarinterativa. 

對策: nslookup來域

nslookup www.labs.lunarinterativa 
Server:   172.224.116.100 
Address:  172.224.116.100#53 

nslookup來反向IP:

nslookup 172.224.116.100 
Server:   172.224.116.100 
Address:  172.224.116.100#53 

100.116.224.172.in-addr.arpa name = interativa32.labs.lunarinterativa. 

現在平就可以了。

對我來說,我明白了我使用的腳本來自Wiliam Oliveira的http://www.vivaolinux.com.br/script/Configuracao-Apache-e-DNS-(bind) ,特別感謝他。你的腳本在我的環境中沒有錯誤。