Foro de elhacker.net

Sistemas Operativos => GNU/Linux => Mensaje iniciado por: tecasoft en 5 Junio 2015, 21:56 pm



Título: ispconfig problema con bind9
Publicado por: tecasoft en 5 Junio 2015, 21:56 pm
buenas, ante todo saludos a todos los hackers del foro, quisiera comentar un problema que me ocurre con las dns de bind9 y el programa ISPCONFIG, he seguido este tutorial y no encuentro porque no me resuelve las direcciones bind9, alguien que me pueda hechar un cable estoy desesperado. Gracias.

http://www.colibris.es/tutorial/como-configurar-ispconfig

este es el proceso que he seguido y no me ha dado ningun problema hasta que llegan las malditas dns, no se donde se crean los archivos de las dns ispconfig ni nada, estoy un poco pobre en esto de las dns.



por lo que he podido probar es que si en el cliente toco el /etc/hosts
y le agrego 192.168.1.200 tecasoft.local me redirige sin problema, pero asi no funciona realmente las dns, alguna pista


Título: Re: ispconfig problema con bind9
Publicado por: MinusFour en 5 Junio 2015, 22:12 pm
Los archivos de DNS se encuentran en /etc/bind. Tienes que configurar las zonas en el named.conf y en sus archivos respectivos.


Título: Re: ispconfig problema con bind9
Publicado por: tecasoft en 5 Junio 2015, 22:14 pm
he probado a hacer:
Código:
dig tecasoft.local

y nada de nada

con:
Código:
dig www.debian.org

funciona bien da respuesta tanto cliente como server 7 wheezy con ispconfig,
que esta sucediendo...


Título: Re: ispconfig problema con bind9
Publicado por: MinusFour en 5 Junio 2015, 22:20 pm
Si tienes tecasoft.local en tu archivo /etc/hosts entonces este no es un registro de DNS. Dig hace una query a un servidor DNS, en este caso es el que aparece en /etc/resolv.conf. En ningun momento haz puesto la entrada en ningun servidor DNS por lo que no esperes una respuesta de un programa que le pregunta a los servidores DNS.

Si haces un nslookup tecasoft.local desde tu maquina que tiene el /etc/hosts si debería resolverte a una ip.


Título: Re: ispconfig problema con bind9
Publicado por: tecasoft en 5 Junio 2015, 22:31 pm
desde el cliente:

Código:
tronic@debian-2:~$ nslookup tecasoft.local
Server: 87.216.1.65
Address: 87.216.1.65#53

** server can't find tecasoft.local: NXDOMAIN

me crea este archivo en el servidor:

Código:
root@tecasoft:/etc/bind# cat pri.tecasoft.local.err 
$TTL        3600
@       IN      SOA     ns1.tecasoft.local. webmaster.tecasoft.local. (
                        2015060501       ; serial, todays date + todays serial #
                        7200              ; refresh, seconds
                        540              ; retry, seconds
                        604800              ; expire, seconds
                        86400 )            ; minimum, seconds
;

mail 3600 A        192.168.1.200
tecasoft.local. 3600 A        192.168.1.200
www 3600 A        192.168.1.200
tecasoft.local. 3600      MX    10   mail.tecasoft.local.
tecasoft.local. 3600      NS        ns1.tecasoft.local.
tecasoft.local. 3600      NS        ns2.tecasoft.local.



ispconfig me crea ese archivo dentro de /etc/bind cuando le agrego una zona dns desde su panel


Título: Re: ispconfig problema con bind9
Publicado por: MinusFour en 5 Junio 2015, 22:37 pm
Hazlo así:

Código
  1. dig @127.0.0.1 tecasoft.local

Porfavor no hagas doble post y sigue estos consejos (http://foro.elhacker.net/gnulinux/usando_etiquetas_apropiadas_para_los_mensajes_con_codigologserrores-t434928.0.html).


Título: Re: ispconfig problema con bind9
Publicado por: tecasoft en 5 Junio 2015, 22:58 pm
Código
  1. root@tecasoft:/etc/bind# dig @127.0.0.1 tecasoft.local
  2.  
  3. ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> @127.0.0.1 tecasoft.local
  4. ; (1 server found)
  5. ;; global options: +cmd
  6. ;; Got answer:
  7. ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 52182
  8. ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
  9.  
  10. ;; QUESTION SECTION:
  11. ;tecasoft.local. IN A
  12.  
  13. ;; AUTHORITY SECTION:
  14. . 6235 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2015060501 1800 900 604800 86400
  15.  
  16. ;; Query time: 0 msec
  17. ;; SERVER: 127.0.0.1#53(127.0.0.1)
  18. ;; WHEN: Fri Jun  5 22:55:07 2015
  19. ;; MSG SIZE  rcvd: 107
  20.  
  21.  


Título: Re: ispconfig problema con bind9
Publicado por: MinusFour en 5 Junio 2015, 23:12 pm
Es algo medio raro, el query lo estas haciendo a tu server DNS pero contesta el SOA de a.root-servers.net?

Haz esto y pon el resultado:

Código
  1. dig @127.0.0.1 tecasoft.local +trace


Título: Re: ispconfig problema con bind9
Publicado por: tecasoft en 5 Junio 2015, 23:24 pm
Código
  1. root@tecasoft:/etc/bind# dig @127.0.0.1 tecasoft.local +trace
  2.  
  3. ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> @127.0.0.1 tecasoft.local +trace
  4. ; (1 server found)
  5. ;; global options: +cmd
  6. . 511579 IN NS m.root-servers.net.
  7. . 511579 IN NS f.root-servers.net.
  8. . 511579 IN NS c.root-servers.net.
  9. . 511579 IN NS i.root-servers.net.
  10. . 511579 IN NS d.root-servers.net.
  11. . 511579 IN NS l.root-servers.net.
  12. . 511579 IN NS b.root-servers.net.
  13. . 511579 IN NS h.root-servers.net.
  14. . 511579 IN NS g.root-servers.net.
  15. . 511579 IN NS a.root-servers.net.
  16. . 511579 IN NS k.root-servers.net.
  17. . 511579 IN NS j.root-servers.net.
  18. . 511579 IN NS e.root-servers.net.
  19. ;; Received 228 bytes from 127.0.0.1#53(127.0.0.1) in 1595 ms
  20.  
  21. . 86400 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2015060501 1800 900 604800 86400
  22. ;; Received 107 bytes from 198.41.0.4#53(198.41.0.4) in 83 ms
  23.  
  24.  


Título: Re: ispconfig problema con bind9
Publicado por: MinusFour en 6 Junio 2015, 00:30 am
El servidor creo que no encuentra la zona y la esta delegando a otro servidor DNS. Puedes poner el contenido de /etc/bind/named.conf?


Título: Re: ispconfig problema con bind9
Publicado por: tecasoft en 6 Junio 2015, 01:01 am
Código
  1. root@tecasoft:/etc/bind# cat named.conf
  2. // This is the primary configuration file for the BIND DNS server named.
  3. //
  4. // Please read /usr/share/doc/bind9/README.Debian.gz for information on the
  5. // structure of BIND configuration files in Debian, *BEFORE* you customize
  6. // this configuration file.
  7. //
  8. // If you are just adding zones, please do that in /etc/bind/named.conf.local
  9.  
  10. include "/etc/bind/named.conf.options";
  11. include "/etc/bind/named.conf.local";
  12. include "/etc/bind/named.conf.default-zones";
  13.  
  14.  


Código
  1. root@tecasoft:/etc/bind# cat named.conf.default-zones
  2. // prime the server with knowledge of the root servers
  3. zone "." {
  4. type hint;
  5. file "/etc/bind/db.root";
  6. };
  7.  
  8. // be authoritative for the localhost forward and reverse zones, and for
  9. // broadcast zones as per RFC 1912
  10.  
  11. zone "localhost" {
  12. type master;
  13. file "/etc/bind/db.local";
  14. };
  15.  
  16. zone "127.in-addr.arpa" {
  17. type master;
  18. file "/etc/bind/db.127";
  19. };
  20.  
  21. zone "0.in-addr.arpa" {
  22. type master;
  23. file "/etc/bind/db.0";
  24. };
  25.  
  26. zone "255.in-addr.arpa" {
  27. type master;
  28. file "/etc/bind/db.255";
  29. };
  30.  
  31.  

Código
  1. root@tecasoft:/etc/bind# cat named.conf.options
  2. options {
  3. directory "/var/cache/bind";
  4.  
  5. // If there is a firewall between you and nameservers you want
  6. // to talk to, you may need to fix the firewall to allow multiple
  7. // ports to talk.  See http://www.kb.cert.org/vuls/id/800113
  8.  
  9. // If your ISP provided one or more IP addresses for stable
  10. // nameservers, you probably want to use them as forwarders.  
  11. // Uncomment the following block, and insert the addresses replacing
  12. // the all-0's placeholder.
  13.  
  14. // forwarders {
  15. // 0.0.0.0;
  16. // };
  17.  
  18. //========================================================================
  19. // If BIND logs error messages about the root key being expired,
  20. // you will need to update your keys.  See https://www.isc.org/bind-keys
  21. //========================================================================
  22. dnssec-validation auto;
  23.  
  24. auth-nxdomain no;    # conform to RFC1035
  25. listen-on-v6 { any; };
  26. };
  27.  
  28.  


Código
  1. root@tecasoft:/etc/bind# cat zones.rfc1918
  2. zone "10.in-addr.arpa"      { type master; file "/etc/bind/db.empty"; };
  3.  
  4. zone "16.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  5. zone "17.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  6. zone "18.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  7. zone "19.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  8. zone "20.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  9. zone "21.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  10. zone "22.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  11. zone "23.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  12. zone "24.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  13. zone "25.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  14. zone "26.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  15. zone "27.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  16. zone "28.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  17. zone "29.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  18. zone "30.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  19. zone "31.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
  20.  
  21. zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
  22.  
  23.  

Código
  1. root@tecasoft:/etc/bind# cat db.empty
  2. ; BIND reverse data file for empty rfc1918 zone
  3. ;
  4. ; DO NOT EDIT THIS FILE - it is used for multiple zones.
  5. ; Instead, copy it, edit named.conf, and use that copy.
  6. ;
  7. $TTL 86400
  8. @ IN SOA localhost. root.localhost. (
  9.      1 ; Serial
  10. 604800 ; Refresh
  11.  86400 ; Retry
  12. 2419200 ; Expire
  13.  86400 ) ; Negative Cache TTL
  14. ;
  15. @ IN NS localhost.
  16.  
  17.  


Título: Re: ispconfig problema con bind9
Publicado por: MinusFour en 6 Junio 2015, 01:28 am
No esta la zona en cuestión dentro del named.conf. ¿Será algo del ispconfig? Creo que el script no tiene permisos para escribir sobre el archivo, por eso no pudo agregar la zona. Aunque... creo que la carpeta de /etc/bind es igual de restrictiva.


Título: Re: ispconfig problema con bind9
Publicado por: tecasoft en 6 Junio 2015, 01:48 am
que me recomiendas que haga?


Título: Re: ispconfig problema con bind9
Publicado por: MinusFour en 6 Junio 2015, 02:03 am
que me recomiendas que haga?

Pues puedes intentar ponerle permisos de escrituras a others pero siento que no es una buena idea. Podrías también agregar la zona manualmente. La syntax es parecida a las demás. La zona se debe llamar tecasoft.local y reinicia el server.


Título: Re: ispconfig problema con bind9
Publicado por: tecasoft en 6 Junio 2015, 02:57 am
resuelve tecasoft.local cambiando permisos a la carpeta /etc/bind pero no resuelve www.tecasoft.local


Título: Re: ispconfig problema con bind9
Publicado por: MinusFour en 6 Junio 2015, 03:04 am
resuelve tecasoft.local cambiando permisos a la carpeta /etc/bind pero no resuelve www.tecasoft.local

Es porque necesitas agregar un registro www.


Título: Re: ispconfig problema con bind9
Publicado por: tecasoft en 6 Junio 2015, 03:24 am
me sigue dando problemas cuando le parece va y cuando no, no va, estoy hecho un lio