logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 04-03-2013 16:32:46

cyberfrk
Membre
Inscription : 04-03-2013

DNS local non fonctionnel

Bonjour,

Après lecture de moultes tutos sur Bind sous debian, je n'arrive toujours pas à mettre en place un DNS en local. C'est pourquoi, je m'en remet à vous.
Les vms sont créées avec virtualbox.

Serveur DNS sous la distrib debian squeeze:
nom: server-debian | IP: 192.168.0.17 | domaine: toto.com

Les fichiers de configurations sont les suivants:

/etc/resolv.conf:

search  toto.com
nameserver  192.168.0.17
#nameserver 192.168.0.254




/etc/host.conf:

order hosts, bind
multi on




/etc/hosts:

127.0.0.1 localhost
127.0.1.1 debian-server.toto.com  debian-server
192.168.0.17  debian-server.toto.com  debian-server
192.168.0.18  debian-client.toto.com  debian-client

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters




/etc/hostname:

debian-server




/etc/bind/named.conf:

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
 




/etc/bind/named.conf.local:

//
// 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 "toto.com" {
  type master;
  file "/etc/bind/db.toto.com";
};

zone "0.168.192.in-addr.arpa" {
  type master;
  file "/etc/bind/db.toto.com.inv";
};




/etc/bind/named.conf.options:

options {
  directory "/var/cache/bind";

  // 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.

  // forwarders {
  //  0.0.0.0;
  // };

  auth-nxdomain no;    # conform to RFC1035
  listen-on-v6 { any; };
  listen-on {ANY;};
  allow-recursion { 127.0.0.1; };
};




/etc/bind/db.toto.com

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     debian-server.toto.com. root.toto.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
);
debian-server.toto.com  IN      A       192.168.0.17




/etc/bind/db.toto.com.inv

;
; BIND reverse data file for broadcast zone
;
$TTL    604800
@       IN      SOA     debian-server.toto.com  root.toto.com.  (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
);

; Bind reverse data file for toto.com zone
@       IN      NS      debian-server.
17      IN      PTR     debian-server.toto.com.
18      IN      PTR     debian-client.toto.com.




Voici les commandes que j'ai exécuté pour tester mon serveur:
named-checkconf -z

zone 10.in-addr.arpa/IN: loaded serial 1
zone 16.172.in-addr.arpa/IN: loaded serial 1
zone 17.172.in-addr.arpa/IN: loaded serial 1
zone 18.172.in-addr.arpa/IN: loaded serial 1
zone 19.172.in-addr.arpa/IN: loaded serial 1
zone 20.172.in-addr.arpa/IN: loaded serial 1
zone 21.172.in-addr.arpa/IN: loaded serial 1
zone 22.172.in-addr.arpa/IN: loaded serial 1
zone 23.172.in-addr.arpa/IN: loaded serial 1
zone 24.172.in-addr.arpa/IN: loaded serial 1
zone 25.172.in-addr.arpa/IN: loaded serial 1
zone 26.172.in-addr.arpa/IN: loaded serial 1
zone 27.172.in-addr.arpa/IN: loaded serial 1
zone 28.172.in-addr.arpa/IN: loaded serial 1
zone 29.172.in-addr.arpa/IN: loaded serial 1
zone 30.172.in-addr.arpa/IN: loaded serial 1
zone 31.172.in-addr.arpa/IN: loaded serial 1
zone 168.192.in-addr.arpa/IN: loaded serial 1
zone toto.com/IN: has no NS records                       <----erreur?
zone toto.com/IN: not loaded due to errors.               <----erreur?
_default/toto.com/IN: bad zone                            <----erreur?
zone 0.168.192.in-addr.arpa/IN: loaded serial 1
zone localhost/IN: loaded serial 2
zone 127.in-addr.arpa/IN: loaded serial 1
zone 0.in-addr.arpa/IN: loaded serial 1
zone 255.in-addr.arpa/IN: loaded serial 1



named-checkzone toto.com /etc/bind/db.toto.com

zone toto.com/IN: has no NS records
zone toto.com/IN: not loaded due to errors.



nslookup

> server 192.168.0.17
Default server: 192.168.0.17
Address: 192.168.0.17#53



> server server-debian
nslookup: couldn't get address for 'server-debian': not found



> server-debian.toto.com
Server:         192.168.0.17
Address:        192.168.0.17#53

** server can't find server-debian.toto.com.toto.com: SERVFAIL




nslookup 192.168.0.17

Server:         192.168.0.17
Address:        192.168.0.17#53

17.0.168.192.in-addr.arpa       name = debian-server.toto.com.
 



J'ai beau re(rerere...)lire mes fichiers conf, je ne sais plus quoi faire pour obtenir un serveur DNS local fonctionnel.

Dernière modification par cyberfrk (04-03-2013 17:31:34)

Hors ligne

#2 04-03-2013 21:26:30

captnfab
Admin-Girafe
Lieu : /dev/random
Distrib. : Debian
Noyau : Dur
(G)UI : gui gui, je zuis un doiseau
Inscription : 07-07-2008
Site Web

Re : DNS local non fonctionnel

Salut,
Tu as essayé de changer tes PTR en A ?

captnfab,
Association Debian-Facile, bépo.
TheDoctor: Your wish is my command… But be careful what you wish for.

Hors ligne

#3 05-03-2013 00:32:48

cyberfrk
Membre
Inscription : 04-03-2013

Re : DNS local non fonctionnel

Je penses avoir résolu mon problème en apportant plusieurs modifications. La 1ère est un point manquant après "debian-server.toto.com" à la ligne 5 de
/etc/bind/db.toto.com.inv

;
; BIND reverse data file for broadcast zone
;
$TTL    604800
@       IN      SOA     debian-server.toto.com  root.toto.com.  (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
);

; Bind reverse data file for toto.com zone
@       IN      NS      debian-server.
17      IN      PTR     debian-server.toto.com.
18      IN      PTR     debian-client.toto.com.




named-checkzone toto.com /etc/bind/db.toto.com ne me donne plus d'erreur mais :

zone toto.com/IN: loaded serial 2
OK



Je me suis trompé ci-dessous, en effet, fallait écrire "debian-server" au lieu de "server-debian" suite à "nslookup"...
nslookup

> server server-debian
nslookup: couldn't get address for 'server-debian': not found


> server debian-server
Address: 127.0.1.1#53
Default server: debian-server
Address: 192.168.0.17#53



Idem pour la commande ci-dessous

> server-debian.toto.com
Server:         192.168.0.17
Address:        192.168.0.17#53

** server can't find server-debian.toto.com.toto.com: SERVFAIL


Ca va tout de suite mieux en mettant "debian-server" au lieu de "server-debian"

> debian-server.toto.com
Server:         192.168.0.17
Address:        192.168.0.17#53

Name:   debian-server.toto.com
Address: 192.168.0.17



Question subsidiaire concernant "db.toto.com". Faut-il mettre :
debian-server               IN      A       192.168.0.17
ou
debian-server.toto.com  IN      A       192.168.0.17

Idem pour "db.toto.com.inv":
17      IN      PTR     debian-server.
ou
17      IN      PTR     debian-server.toto.com.

Merci Captnfab mais il me semble que pour chaque enregistrement A ajouté dans /etc/bind/db.toto.com, il faut créer un enregistrement PTR dans le db inversé. Je me trompes?

Hors ligne

Pied de page des forums