Génération
de la clef TSIG
BIND utilise une
signature par clef cryptée (TSIG) pour authentifier certaines
transactions.
Les serveurs DHCP
doivent posséder cette clef pour mettre à jour les
zones DNS.
À l'installation
de Bind, une clef est générée dans le fichier
/etc/bind/rndc.key.
Nous allons copier ce
fichier en le renommant "ns.alex.lan_rndc.key" pour mieux
l'identifier sur le serveur rt1.alex.lan. Nous allons aussi changer
le nom de la clef au passage.
La commande suivante
génère une paire de clefs HMAC-MD5 à 128 bits
intitulée "ns-alex-lan_rndc-key" :
ns:~#
cp /etc/bind/rndc.key /etc/bind/ns.alex.lan_rndc.key
ns:~#
dnssec-keygen -a HMAC-MD5 -b 128 -n USER ns-alex-lan_rndc-key
Kns-alex-lan_rndc-key.+157+49932
ns:~#
ls -1
Kns-alex-lan_rndc-key.+157+49932.key
Kns-alex-lan_rndc-key.+157+49932.private
ns:~#
cat Kns-alex-lan_rndc-key.+157+49932.private
Private-key-format:
v1.2
Algorithm:
157 (HMAC_MD5)
Key:
NDz59ldce6LjUCTuq+YKGA==
key
"ns-alex-lan_rndc-key" {
algorithm
hmac-md5;
secret
"NDz59ldce6LjUCTuq+YKGA==";
};
ns:~# rm Kns-alex-lan_rndc-key.+157+49932.*
//
This is the primary configuration file for the BIND DNS server named.
//
//
Please read /usr/share/doc/bind9/README.Debian.gz for information on
the
//
structure of BIND configuration files in Debian, *BEFORE* you
customize
//
this configuration file.
//
//
If you are just adding zones, please do that in
/etc/bind/named.conf.local
//
Déclaration de nos réseaux en deux catégories :
//
l'interne et l'externe.
//
Cette méthode est connue sous le nom de Split
DNS, elle permet de
//
cacher les informations DNS des réseaux
internes aux clients
//
extérieurs grâce à
des vues.
acl
internals { 127.0.0.0/8; 172.16.0.0/24; 172.17.0.0/16; 172.18.0.0/16;
};
acl
externals { 123.45.67.0/28; };
include
"/etc/bind/named.conf.options";
//
Déclaration de la clef pour les serveurs DHCP.
include
"/etc/bind/ns.alex.lan_rndc.key";
//
Instructions de mise à jour du DNS Secondaire ns1.alex.fr pour
les
//
zones alex.lan, alex.dmz et sr1.alex.lan
server
172.17.0.1 {
provide-ixfr
yes;
};
//
Canal de communication pour administrer Bind
avec l'utilitaire rndc.
controls
{
inet
127.0.0.1 port 953 allow { 127.0.0.1; };
};
//
Zone "." contenant les adresses des serveurs DNS racine
d'Internet.
//
Ce serveur DNS doit résoudre que des
adresses locales.
//
Je devrais commenter ces quatre lignes normalement.
//
Si le serveur ns1.alex.dmz ne répond plus, les serveurs en DMZ
//
interrogeront ce serveur DNS à la place.
//
prime the server with knowledge of the root servers
zone
"." {
type
hint;
file
"/etc/bind/db.root";
};
//
be authoritative for the localhost forward and reverse zones, and for
//
broadcast zones as per RFC 1912
zone
"localhost" {
type
master;
file
"/etc/bind/db.local";
};
zone
"127.in-addr.arpa" {
type
master;
file
"/etc/bind/db.127";
};
zone
"0.in-addr.arpa" {
type
master;
file
"/etc/bind/db.0";
};
zone
"255.in-addr.arpa" {
type
master;
file
"/etc/bind/db.255";
};
//
zone "com" { type delegation-only; };
//
zone "net" { type delegation-only; };
include
"/etc/bind/named.conf.local";
options
{
directory
"/var/cache/bind";
//
If there is a firewall between you and nameservers you want
//
to talk to, you might need to uncomment the query-source
//
directive below. Previous versions of BIND always asked
//
questions using port 53, but BIND 8.1 and later use an unprivileged
//
port by default.
//
//
Sur quelle(s) adresse(s) et port, écouter les requêtes
DNS.
query-source
address * port 53;
//
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.
//
//
Indique le(s) serveur(s) vers lesquelles seront retransmissent
//
les requêtes si votre serveur DNS
ne peut résoudre.
//
Si le(s) serveur(s) ne répond pas, aucun
serveur racine ne sera
//
contacté, donc aucune réponse aux requêtes !
//forwarders
{
// 0.0.0.0;
//};
auth-nxdomain
no; # conform to RFC1035
listen-on-v6
{ any; };
//
Permet de masquer la version de BIND.
version
"SECRET";
//
Contient une liste d'adresses dont le serveur acceptera ou refusera
//
les requêtes :
//
127.0.0.0/8 Autorise localhost.
//
!172.17.0.254 Interdit cette adresse.
//
Autorise les réseaux "internals"
allow-query
{ internals; };
//
Les machines des réseaux alex.lan et sr1.alex.lan
n'ont pas
//
besoin de résoudre des adresses Internet
puisqu'elles passent par un
//
serveur proxy http/ftp. Elles peuvent
uniquement résoudre les domaines
//
alex.lan, sr1.alex.lan, alex.dmz, alex.fr, alex.com, alex.org
//
Par contre si le serveur ns1.alex.dmz ne répond plus, les
machines
//
du réseau alex.dmz interrogeront ce serveur DNS.
allow-recursion
{ 127.0.0.0/8; 172.16.0.0/24; }
//
Autorise le transfert de zones pour le
DNS Secondaire uniquement.
allow-transfer
{ 172.16.0.1; };
//
Indique le port en écoute et les interfaces.
//
Indiquez {*;}; pour écouter toutes les interfaces.
listen-on
port 53 { 127.0.0.1; 172.17.0.1; };
};
//
//
Do any local configuration here
//
//
Consider adding the 1918 zones here, if they are not used in your
//
organization
//include
"/var/cache/bind/zones.rfc1918";
//
Zone de recherche pour le domaine alex.lan
zone
"alex.lan" {
type
master;
file
"/var/cache/bind/db.alex.lan";
//
Autorise uniquement les requêtes venant
des réseaux internes.
allow-query
{ internals; };
//
Autorise la mise à jour (par dhcpd) du fichier de zone
"alex.lan.db" avec la clef.
allow-update
{ key ns-alex-lan_rndc-key; };
//
Autorise le transfert de cette zone vers le DNS Secondaire.
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
//
Zones de recherche inversées pour le domaine alex.lan
zone
"0.17.172.in-addr.arpa" {
type
master;
file
"/var/cache/bind/db.0.17.172.in-addr.arpa";
allow-query
{ internals; };
allow-update
{ key ns-alex-lan_rndc-key; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
zone
"1.17.172.in-addr.arpa" {
type
master;
file
"/var/cache/bind/db.1.17.172.in-addr.arpa";
allow-query
{ internals; };
allow-update
{ key ns-alex-lan_rndc-key; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
zone
"2.17.172.in-addr.arpa" {
type
master;
file
"/var/cache/bind/db.2.17.172.in-addr.arpa";
allow-query
{ internals; };
allow-update
{ key ns-alex-lan_rndc-key; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
//
Zone de recherche pour le domaine sr1.alex.lan
zone
"sr1.alex.lan" {
type
master;
file
"/var/cache/bind/db.sr1.alex.lan";
allow-query
{ internals; };
allow-update
{ key ns-alex-lan_rndc-key; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
//
Zones de recherche inversées pour le domaine sr1.alex.lan
zone
"0.18.172.in-addr.arpa" {
type
master;
file
"/var/cache/bind/db.0.18.172.in-addr.arpa";
allow-query
{ internals; };
allow-update
{ key ns-alex-lan_rndc-key; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
zone
"1.18.172.in-addr.arpa" {
type
master;
file
"/var/cache/bind/db.1.18.172.in-addr.arpa";
allow-query
{ internals; };
allow-update
{ key ns-alex-lan_rndc-key; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
zone
"2.18.172.in-addr.arpa" {
type
master;
file
"/var/cache/bind/db.2.18.172.in-addr.arpa";
allow-query
{ internals; };
allow-update
{ key ns-alex-lan_rndc-key; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
//
Zone de recherche pour le domaine alex.dmz
//
Il n'y aura pas de mise à jour dynamique DHCP pour cette zone.
zone
"alex.dmz" {
type
master;
file
"/var/cache/bind/db.alex.dmz";
allow-query
{ internals; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
//
Zone de recherche inversée pour le domaine alex.dmz
//
Il n'y aura pas de mise à jour dynamique DHCP pour cette zone.
zone
"0.16.172.in-addr.arpa" {
type
master;
file
"/var/cache/bind/db.0.16.172.in-addr.arpa";
allow-query
{ internals; };
allow-transfer
{ 172.16.0.1; };
notify
yes;
};
//
Zone de recherche pour le domaine alex.fr
//
Le serveur DNS ns.alex.lan interrogera le serveur ns1.alex.fr et
//
ns2.alex.fr pour cette zone.
zone
"alex.fr" {
type
forward;
forwarders
{ 172.16.0.1; 89.123.45.3; };
};
//
Zone de recherche pour le domaine alex.com
zone
"alex.com" {
type
forward;
forwarders
{ 172.16.0.1; 89.123.45.3; };
};
//
Zone de recherche pour le domaine alex.org
zone
"alex.org" {
type
forward;
forwarders
{ 172.16.0.1; 89.123.45.3; };
};
;
;
BIND data file : db.alex.lan
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
//
Noms des serveurs DNS gérant cette zone ou domaine.
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
//
Nom du serveur Mail pour le domaine alex.lan.
IN MX 10 nas.alex.dmz.
localhost IN A 127.0.0.1
ns IN A 172.17.0.1
backup IN A 172.17.0.2
pdc IN A 172.17.0.3
bdc IN A 172.17.0.4
printer IN A 172.17.0.5
supervision IN A 172.17.0.6
fs1 IN A 172.17.0.7
fs2 IN A 172.17.0.8
fs IN A 172.17.0.9
rt1 IN A 172.17.0.253
fw2 IN A 172.17.0.254
;
;
BIND data file : db.0.17.172.in-addr.arpa
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
localhost IN A 127.0.0.1
1 IN PTR ns.alex.lan.
2 IN PTR backup.alex.lan.
3 IN PTR pdc.alex.lan.
4 IN PTR bdc.alex.lan.
5 IN PTR printer.alex.lan.
6 IN PTR supervision.alex.lan.
7 IN PTR fs1.alex.lan.
8 IN PTR fs2.alex.lan.
9 IN PTR fs.alex.lan.
253 IN PTR rt1.alex.lan.
254 IN PTR fw2.alex.lan.
;
;
BIND data file : db.1.17.172.in-addr.arpa
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
localhost IN A 127.0.0.1
//
dhcpd se chargera de le remplir ...
;
;
BIND data file : db.2.17.172.in-addr.arpa
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
localhost IN A 127.0.0.1
//
dhcpd se chargera de le remplir ...
;
;
BIND data file : db.sr1.alex.lan
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
localhost IN A 127.0.0.1
rt1 IN A 172.18.0.254
;
;
BIND data file : db.0.18.172.in-addr.arpa
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
localhost IN A 127.0.0.1
254 IN PTR rt1.sr1.alex.lan.
;
;
BIND data file : db.1.18.172.in-addr.arpa
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
localhost IN A 127.0.0.1
//
dhcpd se chargera de le remplir ...
;
;
BIND data file : db.alex.dmz
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
localhost IN A 127.0.0.1
ns1 IN A 172.16.0.1
vpn IN A 172.16.0.2
ftp IN A 172.16.0.3
ntp IN CNAME ftp
proxy IN A 172.16.0.4
mx1 IN A 172.16.0.5
mx2 IN A 172.16.0.6
smtp IN A 172.16.0.7
mail IN A 172.16.0.8
br1 IN A 172.16.0.9
br2 IN A 172.16.0.10
balancer1 IN A 172.16.0.11
balancer2 IN A 172.16.0.12
node1 IN A 172.16.0.13
node2 IN A 172.16.0.14
node3 IN A 172.16.0.15
sql IN A 172.16.0.16
nas1 IN A 172.16.0.17
nas2 IN A 172.16.0.18
nas IN A 172.16.0.19
ldap1 IN CNAME nas
ldap2 IN A 172.16.0.20
gateway IN A 172.16.0.253
fw2 IN A 172.16.0.254
;
;
BIND data file : db.0.16.172.in-addr.arpa
;
$TTL 604800 ;
1 week
@ IN SOA ns.alex.lan.
root.ns.alex.lan. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns.alex.lan.
IN NS ns1.alex.dmz.
localhost IN A 127.0.0.1
1 IN PTR ns1.alex.dmz.
2 IN PTR vpn.alex.dmz.
3 IN PTR ftp.alex.dmz.
4 IN PTR proxy.alex.dmz.
5 IN PTR mx1.alex.dmz.
6 IN PTR mx2.alex.dmz.
7 IN PTR smtp.alex.dmz.
8 IN PTR mail.alex.dmz.
9 IN PTR br1.alex.dmz.
10 IN PTR br2.alex.dmz.
11 IN PTR balancer1.alex.dmz.
12 IN PTR balancer2.alex.dmz.
13 IN PTR node1.alex.dmz.
14 IN PTR node2.alex.dmz.
15 IN PTR node3.alex.dmz.
16 IN PTR sql.alex.dmz.
17 IN PTR nas1.alex.dmz.
18 IN PTR nas2.alex.dmz.
19 IN PTR nas.alex.dmz.
20 IN PTR ldap2.alex.dmz.
253 IN PTR gateway.alex.dmz.
254 IN PTR fw2.alex.dmz.
ns:~# chown -R bind: /var/cache/bind
search
alex.lan sr1.alex.lan alex.dmz
nameserver
127.0.0.1
nameserver
172.16.0.1
#
The loopback network interface
auto
lo eth0
iface
lo inet loopback
#
The primary network interface
allow-hotplug
eth0
iface
eth0 inet static
address
172.17.0.1
netmask
255.255.0.0
gateway
172.17.0.254
up
route add -net 172.18.0.0/16 gw 172.17.0.253
ns:~#
rndc reload
server
reload successful
ns:~# tail -f /var/log/syslog
//
This is the primary configuration file for the BIND DNS server named.
//
//
Please read /usr/share/doc/bind9/README.Debian.gz for information on
the
//
structure of BIND configuration files in Debian, *BEFORE* you
customize
//
this configuration file.
//
//
If you are just adding zones, please do that in
/etc/bind/named.conf.local
acl
internals { 127.0.0.0/8; 172.16.0.0/24; 172.17.0.0/16; 172.18.0.0/16;
};
acl
externals { 123.45.67.0/28; };
include
"/etc/bind/named.conf.options";
//
Demande les mises à jour depuis le DNS Primaire ns.alex.lan
pour les
//
zones alex.lan, alex.dmz et sr1.alex.lan
//
Envoi les mises à jour au DNS Secondaire ns2.alex.fr pour les
zones
//
alex.fr, alex.com et alex.org
server
172.16.0.1 {
request-ixfr
yes;
provide-ixfr
yes;
};
controls
{
inet
127.0.0.1 port 953 allow { 127.0.0.1; };
};
//
prime the server with knowledge of the root servers
zone
"." {
type
hint;
file
"/etc/bind/db.root";
};
//
be authoritative for the localhost forward and reverse zones, and for
//
broadcast zones as per RFC 1912
zone
"localhost" {
type
master;
file
"/etc/bind/db.local";
};
zone
"127.in-addr.arpa" {
type
master;
file
"/etc/bind/db.127";
};
zone
"0.in-addr.arpa" {
type
master;
file
"/etc/bind/db.0";
};
zone
"255.in-addr.arpa" {
type
master;
file
"/etc/bind/db.255";
};
//
zone "com" { type delegation-only; };
//
zone "net" { type delegation-only; };
include
"/etc/bind/named.conf.local";
options
{
directory
"/var/cache/bind";
//
If there is a firewall between you and nameservers you want
//
to talk to, you might need to uncomment the query-source
//
directive below. Previous versions of BIND always asked
//
questions using port 53, but BIND 8.1 and later use an unprivileged
//
port by default.
query-source
address * port 53;
//
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.
//forwarders
{
// 0.0.0.0;
//};
auth-nxdomain
no; # conform to RFC1035
listen-on-v6
{ any; };
version
"SECRET";
allow-recursion
{ 127.0.0.0/8; 172.16.0.0/24; externals; };
//
Autorise le transfert de zones vers le DNS Secondaire
ns2.
allow-transfer
{ 89.123.45.3; };
listen-on
port 53 { 127.0.0.1; 172.16.0.1; 123.45.67.4; };
};
//
//
Do any local configuration here
//
//
Consider adding the 1918 zones here, if they are not used in your
//
organization
//include
"/var/cache/bind/zones.rfc1918";
//
Zone de recherche pour le domaine alex.fr
zone
"alex.fr" {
type
master;
file
"/var/cache/bind/db.alex.fr";
//
Autorise les requêtes venant de tout les
réseaux.
allow-query
{ any; };
//
Autorise le transfert de zone vers le DNS Secondaire.
allow-transfer
{ 89.123.45.3; };
notify
yes;
};
//
Zone de recherche pour le domaine alex.com
zone
"alex.com" {
type
master;
file
"/var/cache/bind/db.alex.com";
allow-query
{ any; };
allow-transfer
{ 89.123.45.3; };
notify
yes;
};
//
Zone de recherche pour le domaine alex.org
zone
"alex.org" {
type
master;
file
"/var/cache/bind/db.alex.org";
allow-query
{ any; };
allow-transfer
{ 89.123.45.3; };
notify
yes;
};
//
Zone de recherche inversée pour le domaine alex.fr
//
Les domaines alex.com et alex.org pointent vers le même réseau
IP que alex.fr
//
Une zone de recherche inversée doit pointer vers un seul
domaine.
//
Dans cet exemple je choisis arbitrairement le domaine alex.fr
zone
"67.45.123.in-addr.arpa" {
type
master;
file
"/var/cache/bind/db.67.45.123.in-addr.arpa";
allow-query
{ any; };
allow-transfer
{ 89.123.45.3; };
notify
yes;
};
//
Demande au DNS Primaire la mise à jour de la zone alex.lan
zone
"alex.lan" {
type
slave;
file
"/var/cache/bind/db.alex.lan";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
//
Demande au DNS Primaire les mises à jour des zones inversées
alex.lan
zone
"0.17.172.in-addr.arpa" {
type
slave;
file
"/var/cache/bind/db.0.17.172.in-addr.arpa";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
zone
"1.17.172.in-addr.arpa" {
type
slave;
file
"/var/cache/bind/db.1.17.172.in-addr.arpa";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
zone
"2.17.172.in-addr.arpa" {
type
slave;
file
"/var/cache/bind/db.2.17.172.in-addr.arpa";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
//
Demande au DNS Primaire la mise à jour de la zone sr1.alex.lan
zone
"sr1.alex.lan" {
type
slave;
file
"/var/cache/bind/db.sr1.alex.lan";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
//
Demande au DNS Primaire les mises à jour des zones inversées.
zone
"0.18.172.in-addr.arpa" {
type
slave;
file
"/var/cache/bind/db.0.18.172.in-addr.arpa";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
zone
"1.18.172.in-addr.arpa" {
type
slave;
file
"/var/cache/bind/db.1.18.172.in-addr.arpa";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
zone
"2.18.172.in-addr.arpa" {
type
slave;
file
"/var/cache/bind/db.2.18.172.in-addr.arpa";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
//
Zone de recherche pour le domaine alex.dmz
zone
"alex.dmz" {
type
slave;
file
"/var/cache/bind/db.alex.dmz";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
//
Zone de recherche inversée pour le domaine alex.dmz
zone
"0.16.172.in-addr.arpa" {
type
slave;
file
"/var/cache/bind/db.0.16.172.in-addr.arpa";
masters
{ 172.17.0.1; };
allow-query
{ internals; };
};
;
;
BIND data file : db.alex.fr
;
$TTL 604800 ;
1 week
@ IN SOA ns1.alex.fr.
root.ns1.alex.fr. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
//
Noms des serveurs DNS gérant cette zone ou domaine.
IN NS ns1.alex.fr.
IN NS ns2.alex.fr.
//
Nom du serveur Mail pour le domaine alex.fr.
IN MX 10 mx.alex.fr.
localhost IN A 127.0.0.1
node IN A 123.45.67.1
www IN CNAME node
groupware
IN CNAME node
secure IN CNAME node
;
IN A 123.45.67.2
;
IN A 123.45.67.3
ns1 IN A 123.45.67.4
vpn IN A 123.45.67.5
ftp IN A 123.45.67.6
proxy IN A 123.45.67.7
mx1 IN A 123.45.67.8
mx2 IN A 123.45.67.9
//
Load Balancing DNS.
//
Nom TTL
mx 600 IN A 123.45.67.8
600 IN A 123.45.67.9
smtp IN A 123.45.67.10
mail IN A 123.45.67.11
gateway IN A 123.45.67.13
;
IN A 123.45.67.12
router IN A 123.45.67.14
;
ns2 IN A 89.123.45.3
;
;
BIND data file : db.67.45.123.in-addr.arpa
;
$TTL 604800 ;
1 week
@ IN SOA ns1.alex.fr.
root.ns1.alex.fr. (
2007071102 ;
Serial (Year|Month|Day|Incremetation)
604800 ;
Refresh (1 week)
86400 ;
Retry (1 day)
2419200 ;
Expire (4 weeks)
604800 ;
Negative cache TTL (1 week)
)
;
IN NS ns1.alex.fr.
IN NS ns2.alex.fr.
localhost IN A 127.0.0.1
1 IN PTR pool.alex.fr.
;2 IN PTR
;3 IN PTR
4 IN PTR ns1.alex.fr.
5 IN PTR vpn.alex.fr.
6 IN PTR ftp.alex.fr.
7 IN PTR proxy.alex.fr.
8 IN PTR mx1.alex.fr.
9 IN PTR mx2.alex.fr.
10 IN PTR smtp.alex.fr.
11 IN PTR mail.alex.fr.
13 IN PTR gateway.alex.fr.
;12 IN PTR
14 IN PTR router.alex.fr.
search
alex.fr alex.dmz alex.lan sr1.alex.lan
nameserver
127.0.0.1
nameserver
172.17.0.1
#
The loopback network interface
auto
lo eth0 eth1
iface
lo inet loopback
#
The primary network interface
allow-hotplug
eth0
iface
eth0 inet static
address
123.45.67.4
netmask
255.255.255.240
gateway
123.45.67.14
iface
eth1 inet static
address
172.16.0.1
netmask
255.255.255.0
broadcast
172.16.0.255
up
route add -net 172.17.0.0/16 gw 172.16.0.254
up
route add -net 172.18.0.0/16 gw 172.16.0.254
ns1:~#
rndc reload
server
reload successful
//
This is the primary configuration file for the BIND DNS server named.
//
//
Please read /usr/share/doc/bind9/README.Debian.gz for information on
the
//
structure of BIND configuration files in Debian, *BEFORE* you
customize
//
this configuration file.
//
//
If you are just adding zones, please do that in
/etc/bind/named.conf.local
include
"/etc/bind/named.conf.options";
//
Demande les mises à jour depuis le DNS Primaire ns1.alex.fr
server
89.123.45.3 {
request-ixfr
yes;
};
controls
{
inet
127.0.0.1 port 953 allow { 127.0.0.1; };
};
//
prime the server with knowledge of the root servers
zone
"." {
type
hint;
file
"/etc/bind/db.root";
};
//
be authoritative for the localhost forward and reverse zones, and for
//
broadcast zones as per RFC 1912
zone
"localhost" {
type
master;
file
"/etc/bind/db.local";
};
zone
"127.in-addr.arpa" {
type
master;
file
"/etc/bind/db.127";
};
zone
"0.in-addr.arpa" {
type
master;
file
"/etc/bind/db.0";
};
zone
"255.in-addr.arpa" {
type
master;
file
"/etc/bind/db.255";
};
//
zone "com" { type delegation-only; };
//
zone "net" { type delegation-only; };
include
"/etc/bind/named.conf.local";
options
{
directory
"/var/cache/bind";
//
If there is a firewall between you and nameservers you want
//
to talk to, you might need to uncomment the query-source
//
directive below. Previous versions of BIND always asked
//
questions using port 53, but BIND 8.1 and later use an unprivileged
//
port by default.
query-source
address * port 53;
//
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.
//forwarders
{
// 0.0.0.0;
//};
auth-nxdomain
no; # conform to RFC1035
listen-on-v6
{ any; };
version
"SECRET";
allow-recursion
{ 127.0.0.0/8; };
//
Pas de transfert de zones vers un DNS Secondaire.
allow-transfer
{ none; };
listen-on
port 53 { 127.0.0.1; 89.123.45.3; };
};
//
//
Do any local configuration here
//
//
Consider adding the 1918 zones here, if they are not used in your
//
organization
//include
"/var/cache/bind/zones.rfc1918";
//
Zone de recherche pour le domaine alex.fr
zone
"alex.fr" {
type
slave;
file
"/var/cache/bind/db.alex.fr";
masters
{ 123.45.67.4; };
allow-query
{ any; };
};
//
Zone de recherche pour le domaine alex.com
zone
"alex.com" {
type
slave;
file
"/var/cache/bind/db.alex.com";
masters
{ 123.45.67.4; };
allow-query
{ any; };
};
//
Zone de recherche pour le domaine alex.org
zone
"alex.org" {
type
slave;
file
"/var/cache/bind/db.alex.org";
masters
{ 123.45.67.4; };
allow-query
{ any; };
};
//
Zone de recherche inversée pour le domaine alex.fr
zone
"67.45.123.in-addr.arpa" {
type
slave;
file
"/var/cache/bind/db.67.45.123.in-addr.arpa";
masters
{ 123.45.67.4; };
allow-query
{ any; };
};
search
alex.fr alex.dmz alex.lan sr1.alex.lan
nameserver
127.0.0.1
nameserver
123.45.67.4
#
The loopback network interface
auto
lo eth0
iface
lo inet loopback
#
The primary network interface
allow-hotplug
eth0
iface
eth0 inet static
address
89.123.45.3
netmask
255.255.255.248
gateway
89.123.45.1
ns2:~#
rndc reload
server
reload successful
#
#
ns.alex.lan configuration file for ISC dhcpd for Debian
#
#
$Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#
#
Indique une mise à jour d'un serveur DNS.
ddns-update-style
interim;
ddns-updates
on;
#
Inclusion de le clef pour mettre à jour le serveur DNS.
include
"/etc/bind/ns.alex.lan_rndc.key";
#
Indique que notre serveur fait autorité sur le réseau
(master)
authoritative;
#
Refuse les adresses MAC en double.
deny
duplicates;
#
Ignore les messages DHCPDECLINE des clients.
#
Permet d'éviter l'abandon successif
d'adresses.
ignore
declines;
#
Si le client DHCP (un visiteur) envoi un FQDN non géré
par le serveur,
#
il n'enregistrera que son nom d'hôte, mais pas son domaine.
ignore
client-updates;
#
DHCP failover.
failover
peer "dhcp_failover" {
primary; #
Déclare ce serveur comme primaire.
address
172.17.0.1; #
Adresse du serveur primaire.
port
519; #
Port d'écoute du serveur primaire.
peer
address 172.17.0.253; # Adresse du
serveur secondaire.
peer
port 519; #
Port d'écoute du serveur secondaire.
max-response-delay
60; # Temps de non
réponse en secondes.
max-unacked-updates
10;
mclt
3600; #
Temps de renouvellement du service en cas d'incertitude.
split
128; #
Répartition des plages d'adresses.
load
balance max seconds 3;
}
#
Les lignes suivantes servent à l'initialisation des deux
serveurs DHCP.
#failover
peer "dhcp_failover" state {
# my
state partner-down;
#}
#
Voir "man dhcp-options" pour la liste des options.
#
Noms ou adresses des serveurs DNS pour tous nos sous-réseaux.
option
domain-name-servers 172.17.0.1, 172.16.0.1;
option
ntp-servers 172.16.0.3;
#
Adresse du serveur WINS.
option
netbios-name-servers 172.17.0.7;
#
Adresse de l'alias IP quand nous traiterons du
tutoriel "Redondance et
#
continuité de service".
#option
netbios-name-servers 172.17.0.9;
#
Configure la méthode de résolution des clients NetBIOS.
#
Ils demandent d'abord au serveur WINS puis en broadcast.
option
netbios-node-type 8;
default-lease-time
18000;
max-lease-time
36000;
#
Use this to send dhcp log messages to a different log file (you also
#
have to hack syslog.conf to complete the redirection).
log-facility
local7;
#
Sous-réseau 172.17.0.0/16.
subnet
172.17.0.0 netmask 255.255.0.0 {
pool
{
#
Déclaration du failover.
failover
peer "dhcp_failover";
deny
dynamic bootp clients;
#
Plages d'adresses couvertes par DHCP.
range
172.17.1.0 172.17.2.255;
#
Nom de votre domaine pour cette zone.
option
domain-name "alex.lan";
#
Information sur votre réseau.
option
routers 172.17.0.254;
option
subnet-mask 255.255.0.0;
option
broadcast-address 172.17.255.255;
#
Mise à jour dynamique.
ddns-domainname
"alex.lan";
#
ddns-rev-domainname "in-addr.arpa"; (déjà
par défaut)
#
Indique dans quelle zone DNS, DHCP peut écrire.
#
Ce sont les zones déclarées dans named.conf pour ce
réseau :
#
#
La zone inversée pour alex.lan
zone
alex.lan {
primary
127.0.0.1;
key
ns-alex-lan_rndc-key;
}
#
Zones inversées pour alex.lan
zone
1.17.172.in-addr.arpa {
primary
127.0.0.1;
key
ns-alex-lan_rndc-key;
}
zone
2.17.172.in-addr.arpa {
primary
127.0.0.1;
key
ns-alex-lan_rndc-key;
}
#
Déclaration des adresses fixes
#
(en dehors de la plage d'adresses couverte)
#
host srv250 {
# hardware
ethernet 00:50:04:87:41:3B;
# fixed-address
172.17.0.250;
# option
host-name "srv250";
#
}
}
}
rt1:~# scp root@172.17.0.1:/etc/bind/ns.alex.lan_rndc.key /etc/dhcp3/
#
#
rt1.alex.lan configuration file for ISC dhcpd for Debian
#
#
$Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#
ddns-update-style
interim;
ddns-updates
on;
include
"/etc/dhcp3/ns.alex.lan_rndc.key";
deny
duplicates;
ignore
declines;
ignore
client-updates;
#
DHCP failover.
failover
peer "dhcp_failover" {
secondary; #
Déclare ce serveur comme secondaire.
address
172.17.0.253; #
Adresse du serveur secondaire.
port
519; #
Port d'écoute du serveur secondaire.
peer
address 172.17.0.1; #
Adresse du serveur primaire.
peer
port 519; #
Port d'écoute du serveur primaire.
max-response-delay
60; # Temps de non
réponse en secondes.
max-unacked-updates
10;
load
balance max seconds 3;
}
#
Les lignes suivantes servent à l'initialisation des deux
serveurs DHCP.
#failover
peer "dhcp_failover" state {
# my
state partner-down;
#}
option
domain-name-servers 172.17.0.1, 172.16.0.1;
option
ntp-servers 172.16.0.3;
option
netbios-name-servers 172.17.0.7;
#option
netbios-name-servers 172.17.0.9;
option
netbios-node-type 8;
default-lease-time
18000;
max-lease-time
36000;
#
Use this to send dhcp log messages to a different log file (you also
#
have to hack syslog.conf to complete the redirection).
log-facility
local7;
#
Sous-réseau 172.17.0.0/16.
subnet
172.17.0.0 netmask 255.255.0.0 {
pool
{
failover
peer "dhcp_failover";
deny
dynamic bootp clients;
range
172.17.1.0 172.17.2.255;
option
domain-name "alex.lan";
option
routers 172.17.0.254;
option
subnet-mask 255.255.0.0;
option
broadcast-address 172.17.255.255;
ddns-domainname
"alex.lan";
zone
alex.lan {
primary
127.0.0.1;
key
ns-alex-lan_rndc-key;
}
zone
1.17.172.in-addr.arpa {
primary
127.0.0.1;
key
ns-alex-lan_rndc-key;
}
zone
2.17.172.in-addr.arpa {
primary
127.0.0.1;
key
ns-alex-lan_rndc-key;
}
#
host srv250 {
# hardware
ethernet 00:50:04:87:41:3B;
# fixed-address
172.17.0.250;
# option
host-name "srv250";
#
}
}
}
#
Sous-réseau 172.18.0.0/16.
subnet
172.18.0.0 netmask 255.255.0.0 {
range
172.18.1.0 172.18.2.255;
option
domain-name "sr1.alex.lan";
option
routers 172.18.0.254;
option
subnet-mask 255.255.0.0;
option
broadcast-address 172.18.255.255;
ddns-domainname
"sr1.alex.lan";
#
La zone de recherche pour sr1.alex.lan
zone
sr1.alex.lan {
primary
172.17.0.1;
key
ns-alex-lan_rndc-key;
}
#
Zones inversées pour sr1.alex.lan
zone
1.18.172.in-addr.arpa {
primary
172.17.0.1;
key
ns-alex-lan_rndc-key;
}
zone
2.18.172.in-addr.arpa {
primary
172.17.0.1;
key
ns-alex-lan_rndc-key;
}
}
search
alex.lan sr1.alex.lan
nameserver
172.17.0.1
nameserver
172.16.0.1
#
The loopback network interface
auto
lo eth0 eth1
iface
lo inet loopback
#
The primary network interface
allow-hotplug
eth0 eth1
iface
eth0 inet static
address
172.17.0.253
netmask
255.255.0.0
gateway
172.17.0.254
iface
eth1 inet static
address
172.18.0.254
netmask
255.255.0.0
#
#
/etc/sysctl.conf - Configuration file for setting system variables
#
See sysctl.conf (5) for information.
#
#kernel.domainname
= example.com
#net/ipv4/icmp_echo_ignore_broadcasts=1
#
Uncomment the following to stop low-level messages on console
#kernel.printk
= 4 4 1 7
##############################################################3
#
Functions previously found in netbase
#
#
Uncomment the next line to enable Spoof protection (reverse-path
filter)
#net.ipv4.conf.default.rp_filter=1
#
Uncomment the next line to enable TCP/IP SYN cookies
#net.ipv4.tcp_syncookies=1
#
Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.conf.default.forwarding=1
#
Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.default.forwarding=1
Copyright © 04/02/2004, Arnofear
![]() |
Ce document est publié sous licence Creative Commons Paternité - Pas d'Utilisation Commerciale - Partage des Conditions Initiales à l'Identique : http://creativecommons.org/licenses/by-nc-sa/3.0/deed.fr |