Estou com dor de cabeça com o DNS.
Digamos que meu IP público é 1.2.3.4, meu IP local é 192.168.0.10 e meu domínio é example.com Estou executando o CentOS em uma máquina virtual (Parallels Desktop for Mac) com uma placa de rede local reservada para isso, assim ele obtém o Ip diretamente do roteador. Eu tenho portas 80.443,53 encaminhadas para 192.168.0.10. Os firewalls do Mac OS e CentOs estão desligados.
O estranho é quando eu digito dig @ 1.2.3.4 exemplo.com do meu outro computador eu recebo:
; <<>> DiG 9.8.3-P1 <<>> @1.2.3.4 example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16941
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. 86400 IN A 1.2.3.4
;; AUTHORITY SECTION:
example.com. 86400 IN NS ns2.example.com.
example.com. 86400 IN NS ns1.example.com.
;; ADDITIONAL SECTION:
ns1.example.com. 86400 IN A 1.2.3.4
ns2.example.com. 86400 IN A 1.2.3.4
;; Query time: 8 msec
;; SERVER: 1.2.3.4#53(1.2.3.4)
;; WHEN: Sat Nov 2 09:37:36 2013
;; MSG SIZE rcvd: 109
mas quando eu digito: dig @ ns1.example.com example.com ele aguarda alguns segundos e retorna dig: não foi possível obter o endereço de 'ns1.dsht.in' : não encontrado
Este é o meu arquivo de configuração: /etc/named.conf
options {
listen-on-v6 { none; };
directory"/var/named";
dump-file"/var/named/data/cache_dump.db";
statistics-file"/var/named/data/named_stats.txt";
memstatistics-file"/var/named/data/named_mem_stats.txt";
allow-query{ localhost; 192.168.0.0/24; };
allow-transfer { localhost; 192.168.0.0/24; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
# change all from here
view "internal" {
match-clients {
localhost;
192.168.0.0/24;
};
zone "." IN {
type hint;
file "named.ca";
};
zone "example.com" IN {
type master;
file "example.com.zone";
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "0.168.192.in-addr.arpa";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
};
view "external" {
match-clients { any; };
allow-query { any; };
recursion no;
zone "example.com" IN {
type master;
file "example.com.zone";
allow-update { none; };
};
zone "4.3.2.1.in-addr.arpa" IN {
type master;
file "4.3.2.1.in-addr.arpa";
allow-update { none; };
};
};
/var/named/exmaple.com.zone
$TTL 86400
@ IN SOA ns1.example.com. host.example.com. (
2013042201 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
; Specify our two nameservers
IN NS ns1.example.com.
IN NS ns2.example.com.
; Resolve nameserver hostnames to IP, replace with your two droplet IP addresses.
ns1 IN A 1.2.3.4
ns2 IN A 1.2.3.4
; Define hostname -> IP pairs which you wish to resolve
@ IN A 1.2.3.4
IN A 1.2.3.4
www IN A 1.2.3.4
server2 IN A 192.168.0.2
* IN A 1.2.3.4
/var/named/4.3.2.1.in-addr.arpa
$TTL 2d ; 172800 seconds
$ORIGIN 4.3.2.1.IN-ADDR.ARPA.
@ IN SOA ns1.example.com. host.example.com. (
2013010304 ; serial number
3h ; refresh
15m ; update retry
3w ; expiry
3h ; nx = nxdomain ttl
)
IN NS ns1.example.com.
IN NS ns2.example.com.
IN PTR example.com.
; etc
/var/named/0.168.192.in-addr.arpa
$TTL 2d ; 172800 seconds
$ORIGIN 0.168.192.IN-ADDR.ARPA.
@ IN SOA ns1.example.com. host.example.com. (
2013010304 ; serial number
3h ; refresh
15m ; update retry
3w ; expiry
3h ; nx = nxdomain ttl
)
IN NS ns1.example.com.
IN NS ns2.example.com.
10 IN PTR example.com.
2 IN PTR server2.example.com
; etc
Ficarei muito feliz se alguém puder me ajudar.
Obrigado antecipadamente
Tags dns networking bind centos