informatica:linux:bind
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
informatica:linux:bind [2010/11/20 16:42] – creado 95.20.4.69 | informatica:linux:bind [2015/01/22 13:33] – [Recargar configuración sin reiniciar] javi | ||
---|---|---|---|
Line 2: | Line 2: | ||
bind, dns, dig, lookup | bind, dns, dig, lookup | ||
+ | |||
===== Instalación ===== | ===== Instalación ===== | ||
- | sudo aptitude update | + | sudo aptitude update; sudo aptitude install bind9 |
===== Configuración ===== | ===== Configuración ===== | ||
- | {code} | + | **/ |
- | sudo mv / | + | |
+ | < | ||
+ | sudo mv / | ||
sudo vim / | sudo vim / | ||
+ | </ | ||
+ | < | ||
// | // | ||
// Do any local configuration here | // Do any local configuration here | ||
Line 33: | Line 37: | ||
file "/ | file "/ | ||
}; | }; | ||
- | {code} | + | |
+ | options | ||
+ | directory "/ | ||
+ | |||
+ | // 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:// | ||
+ | |||
+ | // If your ISP provided one or more IP addresses for stable | ||
+ | // nameservers, | ||
+ | // Uncomment the following block, and insert the addresses replacing | ||
+ | // the all-0' | ||
+ | |||
+ | // forwarders { | ||
+ | // 0.0.0.0; | ||
+ | // }; | ||
+ | |||
+ | forwarders { | ||
+ | # Replace the address below with the address of your provider' | ||
+ | 8.8.8.8; | ||
+ | }; | ||
+ | |||
+ | auth-nxdomain no; # conform to RFC1035 | ||
+ | listen-on-v6 { any; }; | ||
+ | }; | ||
+ | </code> | ||
+ | |||
+ | **/ | ||
+ | |||
+ | < | ||
+ | sudo vim / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $TTL 604800 | ||
+ | @ | ||
+ | 3 ; Serial | ||
+ | | ||
+ | 86400 ; Retry | ||
+ | 2419200 | ||
+ | | ||
+ | ; | ||
+ | @ | ||
+ | dns IN A | ||
+ | www | ||
+ | alias | ||
+ | </ | ||
+ | |||
+ | **/ | ||
+ | |||
+ | < | ||
+ | sudo vim / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ; | ||
+ | ; BIND reverse data file for local loopback interface | ||
+ | ; | ||
+ | $TTL 604800 | ||
+ | @ | ||
+ | 3 ; Serial | ||
+ | | ||
+ | 86400 ; Retry | ||
+ | 2419200 | ||
+ | | ||
+ | ; | ||
+ | @ | ||
+ | 16 IN PTR | ||
+ | 14 IN PTR | ||
+ | </ | ||
+ | |||
+ | ===== Probarlo ===== | ||
+ | |||
+ | 1. Editar siguiente archivo: | ||
+ | |||
+ | sudo cp / | ||
+ | |||
+ | sudo vim / | ||
+ | |||
+ | Con el siguiente contenido: | ||
+ | |||
+ | search example.com | ||
+ | nameserver 192.168.1.16 | ||
+ | |||
+ | La ip 192.168.1.16 es la de la maquina donde esta corriendo bind | ||
+ | |||
+ | 3. (Opcional) Instalar paquetes: | ||
+ | |||
+ | sudo aptitude update; sudo aptitude install dnsutils | ||
+ | |||
+ | 4. Probar: | ||
+ | |||
+ | nslookup www.example.com | ||
+ | |||
+ | Deberia devolver algo parecido a: | ||
+ | |||
+ | < | ||
+ | nslookup www.example.com | ||
+ | Server: | ||
+ | Address: | ||
+ | |||
+ | Name: | ||
+ | Address: 192.168.1.14 | ||
+ | </ | ||
+ | |||
+ | Gracias al forward, por supuesto, tambien resuelve direcciones publicas: | ||
+ | |||
+ | nslookup www.gmail.com | ||
+ | |||
+ | Y deberia devolver: | ||
+ | |||
+ | < | ||
+ | Server: | ||
+ | Address: | ||
+ | |||
+ | Non-authoritative answer: | ||
+ | www.gmail.com canonical name = mail.google.com. | ||
+ | mail.google.com canonical name = googlemail.l.google.com. | ||
+ | Name: | ||
+ | </ | ||
+ | |||
+ | ===== Recargar configuración sin reiniciar ===== | ||
+ | |||
+ | Tras editar los archivos de configuración: | ||
+ | |||
+ | sudo rndc reload | ||
+ | |||
+ | ==== Errores ==== | ||
+ | |||
+ | === Errores === | ||
+ | |||
+ | |||
+ | nslookup jamgo.es | ||
+ | |||
+ | < | ||
+ | Server: | ||
+ | Address: | ||
+ | |||
+ | ** server can't find jamgo.es: REFUSED | ||
+ | </ | ||
+ | |||
+ | Logs: | ||
+ | |||
+ | / | ||
+ | |||
+ | Jan 22 14:28:55 dns-1 named[1082]: | ||
+ | |||
+ | **Solucion** | ||
+ | |||
+ | sudo vim / | ||
+ | |||
+ | Anyadir el rango de IPs que toquen: | ||
+ | |||
+ | < | ||
+ | # ANYADIDO 22/012015 | ||
+ | acl " | ||
+ | 10.7.13.0/ | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | Y editar dentro de el bloque options esto: | ||
+ | |||
+ | < | ||
+ | options { | ||
+ | # ADD | ||
+ | allow-query { trusted; }; | ||
+ | allow-recursion { trusted; }; | ||
+ | allow-query-cache { trusted; }; | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | Recargar config: | ||
+ | |||
+ | sudo / | ||
+ | |
informatica/linux/bind.txt · Last modified: 2015/04/13 20:19 by 127.0.0.1