informatica:linux:bind
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| informatica:linux:bind [2010/11/20 16:47] – 95.20.4.69 | informatica:linux:bind [2015/04/13 20:19] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| 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 ===== | ||
| Line 14: | Line 13: | ||
| < | < | ||
| - | sudo mv / | + | sudo mv / |
| sudo vim / | sudo vim / | ||
| + | </ | ||
| + | < | ||
| // | // | ||
| // Do any local configuration here | // Do any local configuration here | ||
| Line 36: | Line 36: | ||
| notify no; | notify no; | ||
| file "/ | file "/ | ||
| + | }; | ||
| + | |||
| + | 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; }; | ||
| }; | }; | ||
| </ | </ | ||
| Line 43: | Line 68: | ||
| < | < | ||
| sudo vim / | sudo vim / | ||
| + | </ | ||
| + | < | ||
| $TTL 604800 | $TTL 604800 | ||
| - | @ | + | @ |
| 3 ; Serial | 3 ; Serial | ||
| | | ||
| Line 55: | Line 82: | ||
| dns IN A | dns IN A | ||
| www | www | ||
| + | alias | ||
| </ | </ | ||
| Line 62: | Line 89: | ||
| < | < | ||
| sudo vim / | sudo vim / | ||
| + | </ | ||
| + | < | ||
| ; | ; | ||
| ; BIND reverse data file for local loopback interface | ; BIND reverse data file for local loopback interface | ||
| ; | ; | ||
| $TTL 604800 | $TTL 604800 | ||
| - | @ | + | @ |
| 3 ; Serial | 3 ; Serial | ||
| | | ||
| Line 74: | Line 103: | ||
| | | ||
| ; | ; | ||
| - | @ | + | @ |
| 16 IN PTR | 16 IN PTR | ||
| 14 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.1290271644.txt.gz · Last modified: (external edit)
