User Tools

Site Tools


informatica:linux:bind

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
informatica:linux:bind [2011/01/16 19:27] 127.0.0.1informatica: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 install bind9+  sudo aptitude updatesudo aptitude install bind9
  
 +===== Configuración =====
  
 +**/etc/bind/named.conf**
  
 +<code>
 +sudo mv /etc/bind/named.conf /etc/bind/named.conf.old
 +sudo vim /etc/bind/named.conf
 +</code>
  
 +<code>
 +//
 +// Do any local configuration here
 +//
  
-===== Configuración =====+// Consider adding the 1918 zones here, if they are not used in your 
 +// organization 
 +//include "/etc/bind/zones.rfc1918";
  
-**/etc/bind/named.conf.options** 
  
-<code> +zone "example.com"
-sudo mv /etc/bind/named.conf.options.old+     type master; 
 +     file "/etc/bind/db.example.com"; 
 +};
  
-sudo vim /etc/bind/named.conf.options+zone "1.168.192.in-addr.arpa"
 +        type master; 
 +        notify no; 
 +        file "/etc/bind/db.192"; 
 +};
  
 options { options {
Line 38: Line 56:
         forwarders {         forwarders {
         # Replace the address below with the address of your provider's DNS server         # Replace the address below with the address of your provider's DNS server
-        87.216.1.65;+        8.8.8.8;
         };         };
  
Line 44: Line 62:
         listen-on-v6 { any; };         listen-on-v6 { any; };
 }; };
- 
 </code> </code>
- 
-**/etc/bind/named.conf** 
- 
-<code> 
-sudo mv /etc/bind/named.conf.old 
- 
-sudo vim /etc/bind/named.conf 
- 
-// 
-// Do any local configuration here 
-// 
- 
-// Consider adding the 1918 zones here, if they are not used in your 
-// organization 
-//include "/etc/bind/zones.rfc1918"; 
- 
- 
-zone "example.com" { 
-     type master; 
-     file "/etc/bind/db.example.com"; 
-}; 
- 
-zone "1.168.192.in-addr.arpa" { 
-        type master; 
-        notify no; 
-        file "/etc/bind/db.192"; 
-}; 
-</code> 
- 
- 
  
 **/etc/bind/db.example.com** **/etc/bind/db.example.com**
Line 81: Line 68:
 <code> <code>
 sudo vim /etc/bind/db.example.com sudo vim /etc/bind/db.example.com
 +</code>
  
 +<code>
 $TTL    604800 $TTL    604800
-@       IN      SOA     dns.example.com. dns.example.com. (+@       IN      SOA     dns.example.com. root.example.com. (
                               3         ; Serial                               3         ; Serial
                          604800         ; Refresh                          604800         ; Refresh
Line 93: Line 82:
 dns      IN      A       192.168.1.16 dns      IN      A       192.168.1.16
 www     IN      A       192.168.1.14 www     IN      A       192.168.1.14
 +alias     IN      CNAME       www
 </code> </code>
  
Line 100: Line 89:
 <code> <code>
 sudo vim /etc/bind/db.192 sudo vim /etc/bind/db.192
 +</code>
  
 +<code>
 ; ;
 ; BIND reverse data file for local loopback interface ; BIND reverse data file for local loopback interface
 ; ;
 $TTL    604800 $TTL    604800
-@       IN      SOA     ns.example.com. root.example.com. (+@       IN      SOA     dns.example.com. root.example.com. (
                               3         ; Serial                               3         ; Serial
                          604800         ; Refresh                          604800         ; Refresh
Line 112: Line 103:
                          604800 )       ; Negative Cache TTL                          604800 )       ; Negative Cache TTL
 ; ;
-@       IN      NS      ns.+@       IN      NS      dns.
 16      IN      PTR     dns.example.com. 16      IN      PTR     dns.example.com.
 14      IN      PTR     www.example.com. 14      IN      PTR     www.example.com.
 </code> </code>
- 
  
 ===== Probarlo ===== ===== Probarlo =====
Line 122: Line 112:
 1. Editar siguiente archivo: 1. Editar siguiente archivo:
  
-  sudo cp /etc/resolv.con /etc/resolv.conf.bak+  sudo cp /etc/resolv.conf /etc/resolv.conf.bak
  
   sudo vim /etc/resolv.conf   sudo vim /etc/resolv.conf
Line 135: Line 125:
 3. (Opcional) Instalar paquetes: 3. (Opcional) Instalar paquetes:
  
-  sudo aptitude update && sudo aptitude instal dnsutils+  sudo aptitude updatesudo aptitude install dnsutils
  
 4. Probar: 4. Probar:
Line 173: Line 163:
  
   sudo rndc reload   sudo rndc reload
 +  
 +==== Errores ====
 +
 +=== Errores ===
 +
 +
 +  nslookup jamgo.es
 +
 +<code>
 +Server: 127.0.0.1
 +Address: 127.0.0.1#53
 +
 +** server can't find jamgo.es: REFUSED
 +</code>
 +
 +Logs:
 +
 +  /var/log/syslog
 +
 +  Jan 22 14:28:55 dns-1 named[1082]: client 10.7.13.144#34533 (jamgo.es): query (cache) 'jamgo.es/A/IN' denied
 +
 +**Solucion**
 +
 +  sudo vim /etc/bind/named.conf
 +  
 +Anyadir el rango de IPs que toquen:
 +
 +<code>
 +# ANYADIDO 22/012015
 +acl "trusted" {
 +    10.7.13.0/24;
 +};
 +</code>
 +
 +Y editar dentro de el bloque options esto:
 +
 +<code>
 +options {
 +        # ADD
 +        allow-query { trusted; };
 +        allow-recursion { trusted; };
 +        allow-query-cache { trusted; };
 +};
 +</code>
 +
 +Recargar config:
  
 +  sudo /etc/init.d/bind9 reload
 +  
informatica/linux/bind.txt · Last modified: 2015/04/13 20:19 by 127.0.0.1