Diferencia entre revisiones de «DNS Master en paloma»

De CURE - Informática
Saltar a: navegación, buscar
(configuracion mas coqueta)
Línea 20: Línea 20:
 
===Configuración===
 
===Configuración===
  
Los archivos de configuracion del Bind estan en /etc/bind/
+
Los archivos de configuracion del Bind están en /etc/bind/
  
 
  $ sudo vi /etc/bind/named.conf.options
 
  $ sudo vi /etc/bind/named.conf.options
  
root@paloma:~# cat /etc/bind/named.conf.options
+
<pre>
//acl redesNegadas define las redes a denegar consultas al servidor DNS
+
// Archivo de configuracion del DNS master de
acl redesNegadas { 0.0.0.0/8; 1.0.0.0/8; 2.0.0.0/8; 192.0.2.0/24; 224.0.0.0/3; 172.16.0.0/12; 10.0.0.0/8; 192.168.0.0/24; 169.254.0.0/16; 192.168.1.0/24; 192.168.2.0/24;
+
// taller.curerocha.edu.uy y taller.csic.edu.uy
192.168.3.0/24; };
 
options {
 
//desactivamos la cache
 
acache-enable no;
 
directory "/var/cache/bind";
 
//No es necesario forwardear
 
//forwarders {
 
// 164.73.128.5;
 
// 164.73.128.70;
 
// };
 
//No permitimos las consultas salvo las de nuestra zona y las propias del servidor
 
allow-query { 127.0.0.1; };
 
//No permitimos las recusion
 
allow-recursion { none; };
 
//Incluimos las redes de la acl redesNegadas a la lista negra
 
blackhole { redesNegadas; };
 
auth-nxdomain no; # conform to RFC1035
 
listen-on-v6 { any; };
 
// 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://www.kb.cert.org/vuls/id/800113
 
// If your ISP provided one or more IP addresses for stable
 
// nameservers, you probably want to use them as forwarders.
 
// Uncomment the following block, and insert the addresses replacing
 
// the all-0's placeholder.
 
};
 
  
 +
// acl redesNegadas: define las redes a denegar consultas al servidor DNS
 +
acl redesNegadas {
 +
0.0.0.0/8; 1.0.0.0/8;
 +
172.16.0.0/12;
 +
10.0.0.0/8;
 +
192.168.0.0/16;
 +
169.254.0.0/16;
 +
};
 +
 +
options {
 +
//desactivamos la cache
 +
  acache-enable no;
 +
directory "/var/cache/bind";
 +
 +
//No es necesario forwardear
 +
//forwarders {
 +
// 164.73.128.5;
 +
// 164.73.128.70;
 +
// };
 +
 +
//No permitimos las consultas salvo las de nuestro servidor
 +
allow-query { 127.0.0.1; };
 +
# allow-query { none; };
 +
 +
//No permitimos las recusion
 +
  # allow-recursion { none; };
 +
  allow-recursion { 127.0.0.1; };
 +
 +
//Incluimos las redes de la acl redesNegadas a la lista negra
 +
blackhole { redesNegadas; };
 +
 +
auth-nxdomain no;    # conform to RFC1035
 +
listen-on-v6 { any; };
 +
 +
 +
// 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://www.kb.cert.org/vuls/id/800113
 +
 +
// If your ISP provided one or more IP addresses for stable
 +
// nameservers, you probably want to use them as forwarders. 
 +
// Uncomment the following block, and insert the addresses replacing
 +
// the all-0's placeholder.
 +
 +
};
 +
 +
</pre>
  
 
$ sudo vi/etc/bind/named.conf.local
 
$ sudo vi/etc/bind/named.conf.local

Revisión del 17:21 9 jun 2011

Instalación de un servisor DNS Master en paloma:

Conceptos

El DNS es un servicio repartido que resuelve los nombres de dominio en IPs. El "DNS Master" de una zona (por ejemplo taller.curerocha.edu.uy) es el servidor donde se almacena y actualiza la información de los dominios bajo esta zona, y que provee esta información a otros servidores en la red.

Para que un servidor sea DNS Master de una zona, es necesario que el DNS master de la zona de nivel superior le delegue la gestión de dominios (por ejemplo, curerocha.edu.uy es la zona superior de taller.curerocha.edu.uy)

Objetivos de tutorial

Creamos un DNS mastes para las zonas que nos han sido delegadas:

  • taller.csic.edu.uy (que nos fue delegada desde CSIC)
  • taller.curerocha.edu.uy, que nos fue delegada pos SeCIU, que maneja curerocha.edu.uy

Instalación

Necesitamos BIND y algunos utilitarios:

# sudo apt-get install bind9 bind9-doc dnsutils

Configuración

Los archivos de configuracion del Bind están en /etc/bind/

$ sudo vi /etc/bind/named.conf.options
// Archivo de configuracion del DNS master de
// taller.curerocha.edu.uy y taller.csic.edu.uy

// acl redesNegadas: define las redes a denegar consultas al servidor DNS
acl redesNegadas {
	0.0.0.0/8; 1.0.0.0/8;
	172.16.0.0/12;
	10.0.0.0/8;
	192.168.0.0/16; 
	169.254.0.0/16; 
};

options {
	//desactivamos la cache
   	acache-enable no;	
	directory "/var/cache/bind";

	//No es necesario forwardear
	//forwarders {
	 //	164.73.128.5;
	//	164.73.128.70;
	// };

	//No permitimos las consultas salvo las de nuestro servidor
 	allow-query { 127.0.0.1; };
 	# allow-query { none; };

	//No permitimos las recusion
   	# allow-recursion { none; };
   	allow-recursion { 127.0.0.1; };

	//Incluimos las redes de la acl redesNegadas a la lista negra
	blackhole { redesNegadas; };

	auth-nxdomain no;    # conform to RFC1035
	listen-on-v6 { any; };
	

	// 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://www.kb.cert.org/vuls/id/800113

	// If your ISP provided one or more IP addresses for stable 
	// nameservers, you probably want to use them as forwarders.  
	// Uncomment the following block, and insert the addresses replacing 
	// the all-0's placeholder.

};

$ sudo vi/etc/bind/named.conf.local

Editamos este archivo para definir las zonas directas e inversas de nuestro dominio, y los archivos donde estaran las configuraciones de las mismas.

root@paloma:~# cat /etc/bind/named.conf.local
//
// Do any local configuration here
//
//Definimos nuestra zona de dominio taller.csic.edu.uy
//Nuestro dns solo va a contestar por esta zona
zone "taller.csic.edu.uy"{
type master;
file "/etc/bind/db.taller.csic.edu.uy";
allow-query { any;};
};
zone "234.73.164.in-addr.arpa"{
type master;
file "/etc/bind/db.164.73.234";
allow-query { any;};
};
//include "/etc/bind/zones.rfc1918";


Creamos db.taller.csic.edu.uy copiando /etc/bind/db.local como /etc/bind/db.taller.csic.edu.uy


root@paloma:~# cat /etc/bind/db.taller.csic.edu.uy
;
; Archivo BIND de definición de zona de taller.csic.edu.uy
;
$TTL 86400 ; 1D
@ IN SOA taller.csic.edu.uy. root.taller.csic.edu.uy. (
2011060901 ; Serial
6H ; Refresh
1D ; Retry
1W ; Expire
1D ) ; Negative Cache TTL
;
@ IN NS taller.csic.edu.uy.
@ IN A 164.73.234.104
paloma IN A 164.73.234.104
pedrera IN A 164.73.234.102
polonio IN A 164.73.234.103
garzon IN A 164.73.234.126
base-de-datos IN CNAME paloma
tikiwiki IN CNAME paloma
wiki IN CNAME paloma

Creamos db.164.73.234 copiando db.127


root@paloma:~# cat /etc/bind/db.164.73.234
;
; BIND reverse data file for local loopback interface
;
$TTL 86400 ; 1D
@ IN SOA taller.csic.edu.uy. root.taller.csic.edu.uy. (
1 ; Serial
6H ; Refresh
1D ; Retry
1W ; Expire
1D ) ; Negative Cache TTL
;
@ IN NS taller.csic.edu.uy.
@ IN PTR taller.csic.edu.uy.
102 IN PTR pedrera.taller.csic.edu.uy.
103 IN PTR polonio.taller.csic.edu.uy.
104 IN PTR paloma.taller.csic.edu.uy.
126 IN PTR garzon.taller.csic.edu.uy. 


Editamos el archivo /etc/reslov.conf


$ sudo vi /etc/resolv.conf

search taller.csic.edu.uy
domain taller.csic.edu.uy
nameserver 164.73.128.5
nameserver 164.73.128.70


Referencias:

http://linuxsilo.net/articles/bind.html

http://www.javcasta.com/2011/05/09/ubuntu-servidor-dns-cache-para-una-red-local-lan-stub-con-bind9/

http://web.mit.edu/rhel-doc/4/RH-DOCS/rhel-rg-es-4/s1-bind-zone.html