Partage
  • Partager sur Facebook
  • Partager sur Twitter

Bind9

Apprenez le fonctionnement des réseaux TCP/IP

    29 avril 2021 à 13:59:46

    Bonjour,

    J'ai quelques difficultés à réaliser le tp "installation d'un service DNS".

    J'ai installé bind, déclaré mes zones dans le fichier /etc/bind/named.conf.local comme ceci:

    zone "pierreinfo.fr" {
    		type master;
    		file "/etc/bind/db.pierreinfo.fr;
    };
    zone "8.168.192.in-addr.arpa." {
          		type master;
            	file "/etc/bind/db.192.8";
    };
    

    puis j'ai édité les fichiers "db.pierreinfo.fr" :

    $TTL 604800     ; 1 semaine
    $ORIGIN pierreinfo.fr.
    @       IN SOA  ns.pierreinfo.fr. contact.pierreinfo.fr. (
                                    2021042601 ;serial
                                    3600       ; refresh (1 hour)
                                    3000       ; retry (50 minutes)
                                    4619200    ; expire (7 weeks 4 days 11 hours 6 minutes 40 seconds)
                                    604800     ; minimum (1 week)
                                    )
    
    @               IN      NS      ns.pierreinfo.fr.
    @               IN      MX      mx
    ns              IN      A       192.168.8.2
    mx              IN      A       192.168.8.3
    tuto            IN      A       192.168.8.4
    www             IN      A       192.168.8.5
    blog            IN      CNAME   www

     et "db.192.8":

    $TTL 604800     ; 1 semaine
    $ORIGIN 8.168.192.in-addr.arpa.
    @       IN SOA  ns.pierreinfo.fr. contact.pierreinfo.fr (
                                    2021042601 ; serial
                                    3600       ; refresh (1 hour)
                                    3000       ; retry (50 minutes)
                                    4619200    ; expire (7 weeks 4 days 11 hours 6 minutes 40 seconds)
                                    604800     ; minimum (1 week)
                                    )
    
    @               IN      NS        ns.pierreinfo.fr
    1               IN      PTR       ns.pierreinfo.fr
    2               IN      PTR       mx.pierreinfo.fr
    3               IN      PTR       tuto.pierreinfo.fr
    4               IN      PTR       www.pierreinfo.fr
    


    relancé bind:

    sudo service bind9 restart
    

    vérifié le contenu de /etc/resolv.conf :

    - premier problème, le serveur de nom est automatiquement configuré à l'adresse 127.0.0.53 par le service networkmanager .

    J'ai donc désactivé l'automatisation du choix de dns dans les paramètres ipv4 et ai modifié resolv.conf. comme suit:

    # Generated by NetworkManager
    nameserver 127.0.0.1
    nameserver 192.168.8.2
    

    mais il se réinscrit quand même sous l'adresse 127.0.0.53 au bout d'un moment.

    voici le résultat obtenu avec host:

    host -t NS pierreinfo.fr
    Host pierreinfo.fr not found: 3(NXDOMAIN)
    

    et dig:

    dig @localhost pierreinfo.fr ns
    
    
    ; <<>> DiG 9.16.1-Ubuntu <<>> @localhost pierreinfo.fr ns
    ; (1 server found)
    ;; global options: +cmd
    ;; connection timed out; no servers could be reached
    


    la même chose en renseignant cette fois 127.0.0.53

    ; <<>> DiG 9.16.1-Ubuntu <<>> @127.0.0.53 pierreinfo.fr ns
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 32327
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;pierreinfo.fr.			IN	NS
    
    ;; Query time: 160 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: jeu. avril 29 13:34:56 CEST 2021
    ;; MSG SIZE  rcvd: 42

     ainsi qu'un deuxième point qui m'échappe dans le log  de syslog (ci après le résultat de" tail -n 30 /var/log/syslog")

    Apr 29 13:33:56 Probookbuntu named[21689]: BIND 9 is maintained by Internet Systems Consortium,
    Apr 29 13:33:56 Probookbuntu named[21689]: Inc. (ISC), a non-profit 501(c)(3) public-benefit 
    Apr 29 13:33:56 Probookbuntu named[21689]: corporation.  Support and training for BIND 9 are 
    Apr 29 13:33:56 Probookbuntu named[21689]: available at https://www.isc.org/support
    Apr 29 13:33:56 Probookbuntu named[21689]: ----------------------------------------------------
    Apr 29 13:33:56 Probookbuntu named[21689]: adjusted limit on open files from 524288 to 1048576
    Apr 29 13:33:56 Probookbuntu named[21689]: found 4 CPUs, using 4 worker threads
    Apr 29 13:33:56 Probookbuntu named[21689]: using 4 UDP listeners per interface
    Apr 29 13:33:56 Probookbuntu named[21689]: using up to 21000 sockets
    Apr 29 13:33:56 Probookbuntu named[21689]: loading configuration from '/etc/bind/named.conf'
    Apr 29 13:33:56 Probookbuntu named[21689]: /etc/bind/named.conf.local:5: missing ';' before '8.168.192.in-addr.arpa.'
    Apr 29 13:33:56 Probookbuntu named[21689]: /etc/bind/named.conf.local:5: unknown option '8.168.192.in-addr.arpa.'
    Apr 29 13:33:56 Probookbuntu named[21689]: /etc/bind/named.conf.local:9: unexpected end of input 
    Apr 29 13:33:56 Probookbuntu named[21689]: loading configuration: unexpected end of input
    Apr 29 13:33:56 Probookbuntu named[21689]: exiting (due to fatal error)
    Apr 29 13:33:56 Probookbuntu systemd[1]: named.service: Main process exited, code=exited, status=1/FAILURE
    Apr 29 13:33:56 Probookbuntu systemd[1]: named.service: Failed with result 'exit-code'.
    Apr 29 13:39:01 Probookbuntu CRON[21749]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
    

    On m'indique qu'il manque un ";" en ligne 5 de mon fichier de zone, je n'arrive pas à corriger cette erreur.

    voici en prime le résultat de ls -la /etc/bind/:

    total 80
    drwxr-sr-x   2 root bind  4096 avril 29 13:53 .
    drwxr-xr-x 142 root root 12288 avril 29 13:23 ..
    -rw-r--r--   1 root root   237 déc.  17  2019 db.0
    -rw-r--r--   1 root root   271 déc.  17  2019 db.127
    -rw-r--r--   1 root root   575 avril 26 14:48 db.192
    -rw-r--r--   1 root bind   751 avril 26 16:11 db.192.8
    -rw-r--r--   1 root bind 12288 avril 26 14:16 .db.192.swp
    -rw-r--r--   1 root root   237 déc.  17  2019 db.255
    -rw-r--r--   1 root root   353 déc.  17  2019 db.empty
    -rw-r--r--   1 root root   270 déc.  17  2019 db.local
    -rw-r--r--   1 root bind   780 avril 26 17:42 db.pierreinfo.fr
    -rw-r--r--   1 root bind   463 déc.  17  2019 named.conf
    -rw-r--r--   1 root bind   498 déc.  17  2019 named.conf.default-zones
    -rw-r--r--   1 root bind   171 avril 29 13:53 named.conf.local
    -rw-r--r--   1 root bind   846 déc.  17  2019 named.conf.options
    -rw-r-----   1 bind bind   100 avril 26 11:11 rndc.key

    ss -antp renvoi aussi

    LISTEN               0                 4096                         127.0.0.53%lo:53                                  0.0.0.0:*                users:(("systemd-resolve",pid=932,fd=13))                                                                                                    
    LISTEN               0                 5                                127.0.0.1:631                                 0.0.0.0:*                users:(("cupsd",pid=986,fd=7))                                                                                                               
    

    Voici aussi mes interfaces réseau:

    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever

    2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether "adressemaceffacée" brd ff:ff:ff:ff:ff:ff inet 192.168.8.2/24 brd 192.168.8.255 scope global noprefixroute enp0s25 valid_lft forever preferred_lft forever inet6 fe80::6c6:19b1:6f3a:2815/64 scope link noprefixroute valid_lft forever preferred_lft forever

    3: wlo1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether "adressemaceffacée" brd ff:ff:ff:ff:ff:ff altname wlp2s0

    (ip fix pr enp0s25 dhcp désactivé)

    Par pitié pour les quelques cheveux me restant sur la tête, quelqun peut-il m'aider ? :'(


    Merci

    -
    Edité par PierreEtrillard 29 avril 2021 à 16:05:34

    • Partager sur Facebook
    • Partager sur Twitter

    Bind9

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown