En effet c’est bien cela, autant pour moi.
Je ne sais pas si tu lis l’anglais, mais le site Zytrax propose des guides et des exemples qui m’ont beaucoup aidé. Je n’ai pas trouvé d’équivalent en français.
http://www.zytrax.com/books/dns/
Autre piège : certains programmes comme resolvconf et, semble-t-il depuis peu, NetworkManager remplacent le fichier resolv.conf par un lien symbolique pointant vers un fichier dans /run qui est un système de fichiers temporaire en mémoire (tmpfs). Toute modification manuelle de ce fichier est donc perdue au démarrage suivant de toute façon.
merci
Bonjour @PascalHambourg
STP aide moi, mon serveur DHCP n’arrive toujours pas à mettre à jour mes fichiers de zone pourtant les serveurs DHCP et DNS marchent bien de part et d’autre. Voici les contenus de mes fichiers
## SERVEUR DNS
root@groupe5-srv-dns:/home/magir# /etc/init.d/bind9 status
● bind9.service - BIND Domain Name Server
Loaded: loaded (/lib/systemd/system/bind9.service; enabled)
Drop-In: /run/systemd/generator/bind9.service.d
└─50-insserv.conf-$named.conf
Active: active (running) since mer. 2018-01-10 10:29:40 GMT; 6s ago
Docs: man:named(8)
Process: 2543 ExecStop=/usr/sbin/rndc stop (code=exited, status=0/SUCCESS)
Main PID: 2548 (named)
CGroup: /system.slice/bind9.service
└─2548 /usr/sbin/named -f -u bind
janv. 10 10:29:40 groupe5-srv-dns named[2548]: managed-keys-zone: loaded serial 76
janv. 10 10:29:40 groupe5-srv-dns named[2548]: zone 0.in-addr.arpa/IN: loaded serial 1
janv. 10 10:29:40 groupe5-srv-dns named[2548]: zone 43.168.192.in-addr.arpa/IN: loaded serial 1
janv. 10 10:29:40 groupe5-srv-dns named[2548]: zone groupe5.org/IN: loaded serial 2
janv. 10 10:29:40 groupe5-srv-dns named[2548]: zone 255.in-addr.arpa/IN: loaded serial 1
janv. 10 10:29:40 groupe5-srv-dns named[2548]: zone localhost/IN: loaded serial 2
janv. 10 10:29:40 groupe5-srv-dns named[2548]: zone 127.in-addr.arpa/IN: loaded serial 1
janv. 10 10:29:40 groupe5-srv-dns named[2548]: all zones loaded
janv. 10 10:29:40 groupe5-srv-dns named[2548]: running
janv. 10 10:29:40 groupe5-srv-dns named[2548]: zone 43.168.192.in-addr.arpa/IN: sending notifies (serial 1)
## GNU nano 2.2.6 Fichier : /etc/bind/db.groupe5.org
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA groupe5-srv-dns.groupe5.org. root.groupe5-srv-dns.groupe5.org. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS groupe5-srv-dns.groupe5.org.
groupe5-srv-dns IN A 192.168.43.111
groupe5-srv-dhcp IN A 192.168.43.110
groupe5-client-linux IN A 192.168.43.11
client-win IN A 192.168.43.17
## GNU nano 2.2.6 Fichier : /etc/bind/db.192
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA groupe5-srv-dns.groupe5.org. root.groupe5-srv-dns.groupe5.org. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS groupe5-srv-dns.
111 IN PTR groupe5-srv-dns.groupe5.org.
110 IN PTR groupe5-srv-dhcp.groupe5.org.
11 IN PTR groupe5-client-linux.groupe5.org.
17 IN PTR client-win.groupe5.org.
SERVER DHCP
## Titre
root@groupe5-srv-dhcp:/home/magir# tail -f /var/log/syslog
Jan 10 10:17:02 groupe5-srv-dhcp dhcpd: DHCPREQUEST for 192.168.43.17 from 00:0c:29:9d:39:cd (groupe5-client-linux) via eth0
Jan 10 10:17:02 groupe5-srv-dhcp dhcpd: DHCPACK on 192.168.43.17 to 00:0c:29:9d:39:cd via eth0
Jan 10 10:18:15 groupe5-srv-dhcp systemd[1]: Starting Cleanup of Temporary Directories...
Jan 10 10:18:15 groupe5-srv-dhcp systemd[1]: Started Cleanup of Temporary Directories.
Jan 10 10:25:17 groupe5-srv-dhcp dhcpd: DHCPREQUEST for 192.168.43.14 from 78:7d:48:10:d5:fd (android-b694042002b3d948) via eth0
Jan 10 10:25:17 groupe5-srv-dhcp dhcpd: DHCPACK on 192.168.43.14 to 78:7d:48:10:d5:fd (android-b694042002b3d948) via eth0
Jan 10 10:25:19 groupe5-srv-dhcp dhcpd: DHCPREQUEST for 192.168.43.14 from 78:7d:48:10:d5:fd (android-b694042002b3d948) via eth0
Jan 10 10:25:19 groupe5-srv-dhcp dhcpd: DHCPACK on 192.168.43.14 to 78:7d:48:10:d5:fd via eth0
Jan 10 10:28:07 groupe5-srv-dhcp dhcpd: DHCPREQUEST for 192.168.43.19 from 58:48:22:68:f8:01 (android-d0b5a6c2f3acc893) via eth0
Jan 10 10:28:07 groupe5-srv-dhcp dhcpd: DHCPACK on 192.168.43.19 to 58:48:22:68:f8:01 (android-d0b5a6c2f3acc893) via eth0
Jan 10 10:30:56 groupe5-srv-dhcp dhcpd: DHCPREQUEST for 192.168.43.17 from 00:0c:29:9d:39:cd via eth0
Jan 10 10:30:56 groupe5-srv-dhcp dhcpd: DHCPACK on 192.168.43.17 to 00:0c:29:9d:39:cd (groupe5-client-linux) via eth0
Jan 10 10:34:25 groupe5-srv-dhcp dhcpd: DHCPDISCOVER from 00:0c:29:9d:39:cd (groupe5-client-linux) via eth0
Jan 10 10:34:26 groupe5-srv-dhcp dhcpd: DHCPOFFER on 192.168.43.17 to 00:0c:29:9d:39:cd (groupe5-client-linux) via eth0
Jan 10 10:34:26 groupe5-srv-dhcp dhcpd: DHCPREQUEST for 192.168.43.17 (192.168.43.110) from 00:0c:29:9d:39:cd (groupe5-client-linux) via eth0
Jan 10 10:34:26 groupe5-srv-dhcp dhcpd: DHCPACK on 192.168.43.17 to 00:0c:29:9d:39:cd via eth0
Jan 10 10:34:26 groupe5-srv-dhcp dhcpd: DHCPREQUEST for 192.168.43.17 (192.168.43.110) from 00:0c:29:9d:39:cd via eth0
Jan 10 10:34:26 groupe5-srv-dhcp dhcpd: DHCPACK on 192.168.43.17 to 00:0c:29:9d:39:cd via eth0
## si je fais tail -f /var/log/syslog sur le serveur DNS j'ai ce resultat. L'adresse ip 192.168.43.20 est l'adresse de mon poste physique
root@groupe5-srv-dns:/home/magir# nano /etc/bind/db.groupe5.org
root@groupe5-srv-dns:/home/magir# nano /etc/bind/db.192
root@groupe5-srv-dns:/home/magir# tail -f /var/log/syslog
Jan 10 10:29:40 groupe5-srv-dns named[2548]: managed-keys-zone: loaded serial 76
Jan 10 10:29:40 groupe5-srv-dns named[2548]: zone 0.in-addr.arpa/IN: loaded serial 1
Jan 10 10:29:40 groupe5-srv-dns named[2548]: zone 43.168.192.in-addr.arpa/IN: loaded serial 1
Jan 10 10:29:40 groupe5-srv-dns named[2548]: zone groupe5.org/IN: loaded serial 2
Jan 10 10:29:40 groupe5-srv-dns named[2548]: zone 255.in-addr.arpa/IN: loaded serial 1
Jan 10 10:29:40 groupe5-srv-dns named[2548]: zone localhost/IN: loaded serial 2
Jan 10 10:29:40 groupe5-srv-dns named[2548]: zone 127.in-addr.arpa/IN: loaded serial 1
Jan 10 10:29:40 groupe5-srv-dns named[2548]: all zones loaded
Jan 10 10:29:40 groupe5-srv-dns named[2548]: running
Jan 10 10:29:40 groupe5-srv-dns named[2548]: zone 43.168.192.in-addr.arpa/IN: sending notifies (serial 1)
Jan 10 11:10:07 groupe5-srv-dns named[2548]: client 192.168.43.20#53445: update 'groupe5.org/IN' denied
Jan 10 11:15:07 groupe5-srv-dns named[2548]: client 192.168.43.20#58053: update 'groupe5.org/IN' denied
Jan 10 11:17:01 groupe5-srv-dns CRON[2889]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Le seul message “d’erreur” que je vois, c’est [quote=“sally, post:25, topic:75590”]
Jan 10 11:10:07 groupe5-srv-dns named[2548]: client 192.168.43.20#53445: update ‘groupe5.org/IN’ denied
[/quote]Tout le reste me semble normal.
Pour ce qui est de ce message sur ton ip perso, c’est ta machine windows qui tente de mettre à jour dynamiquement ta zone, et (logiquement), le serveur lui refuse la modification. Rien de génant, tout me semble fonctionner, ça veut même dire que le serveur dhcp distribue bien l’adresse du serveur dns.
salut @mattotop. Je te remercie. Mais normalement il doit avoir une modification au niveau des fichiers de zone directe et reverse mais moi je n’ai aucun changement. aussi ce n’est pas la seule adresse que le serveur DHCP attribue. je n’ai aucune trace des autres clients à qui DHCP attribue des adresses
Alors non, tu as bien les trace d’attribution, ce sont les lignes DHCPACK de /var/log/syslog.
Ce que tu n’as pas, c’est l’association dynamique des noms aux ips sur ton dns, mais c’est autrechose.
Ca se fait je crois en configurant une ligne allow-update dans ta zone, et c’est il me semble une grosse faiblesse de sécurité.
Personnellement, j’attribuerais dans le dhcp une adresse fixe en fonction de la mac pour quelques machines du réseau qu’il est utile de nommer, je mettrais en dur ces noms dans les zones dns, et je laisserais l’update dynamique désactivé.
J’ai dit une bétise, dans ton fichier de zone, c’est une ligne update-policy qu’il faut, et ça a l’ailr d’être plus secure que l’update dynamique “old schoom”.
Il faut aussi configurer le serveur DHCP pour demander la mise à jour des enregistrements DNS. Si c’était le cas, il me semble qu’il y aurait des traces dans les logs.
si @PascalHambourg j’ai configuré mon DHCP. Voici le contenu de mon fichier /etc/dhcp/dhcpd.conf
## contenu de /etc/dhcp/dhcpd.conf
authoritative;
ddns-updates on;
ddns-update-style interim;
ignore client-updates;
update-static-leases on;
log-facility local7;
subnet 192.168.43.0 netmask 255.255.255.0 {
range 192.168.43.10 192.168.43.100;
option domain-name-servers 127.0.0.1;
option domain-name "groupe5.org";
option netbios-name-servers 192.168.43.111;
option routers 192.168.43.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.43.255;
default-lease-time 3600;
max-lease-time 7200;
ddns-domainname "groupe5.org";
ddns-rev-domainname "in-addr.arpa";
}
# La clé autorisant DHCP à écrire dans la base DNS
key "rndc-key" {
algorithm hmac-md5;
secret "Gbng/tYP7r7enhfs;l,jhfO4+g==";
};
# indique dans quelle zone DNS, DHCP doit écrire
zone db.groupe5.org. {
primary 192.168.43.111;
key rndc-key;
}
zone 43.168.192.in-addr.arpa. {
primary 192.168.43.111;
key rndc-key;
}
L’adresse ip primary est l’adresse ip de mon DNS
si voici
# indique dans quelle zone DNS, DHCP doit écrire
zone db.groupe5.org.{
primary 192.168.43.111;
key rndc-key;
}
zone 43.168.192.in-addr.arpa. {
primary 192.168.43.111;
key rndc-key;
}
Ceci est la configuration du serveur DHCP, et elle me semble erronée puisqu’elle fait référence à une zone db.groupe5.org qui n’est pas définie dans la configuration du serveur DNS.
PS : merci d’appliquer le formatage de texte brut aux fichiers de configuration comme dans le message initial.
voici les configurations du DNS
## GNU nano 2.2.6 Fichier : /etc/bind/db.groupe5.org
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA groupe5-srv-dns.groupe5.org. root.groupe5-srv-dns.groupe5.org. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS groupe5-srv-dns.groupe5.org.
groupe5-srv-dns IN A 192.168.43.111
groupe5-srv-dhcp IN A 192.168.43.110
groupe5-client-linux IN A 192.168.43.11
client-win IN A 192.168.43.17
## GNU nano 2.2.6 Fichier : /etc/bind/db.192
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA groupe5-srv-dns.groupe5.org. root.groupe5-srv-dns.groupe5.org. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS groupe5-srv-dns.
111 IN PTR groupe5-srv-dns.groupe5.org.
110 IN PTR groupe5-srv-dhcp.groupe5.org.
11 IN PTR groupe5-client-linux.groupe5.org.
17 IN PTR client-win.groupe5.org.
## GNU nano 2.2.6 Fichier : /etc/bind/named.conf
// 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";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
include "/etc/bind/rndc.key";
## /etc/bind/named.conf.options
controls {
inet 127.0.0.1 allow { localhost; } keys { rndc-key;};
};
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 {
192.168.43.111;
8.8.8.8;
8.8.4.4;
// 212.27.40.240;
// 212.27.40.241;
};
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
version none;
forward only;
// listen-on-v6 { any; };
};
## GNU nano 2.2.6 Fichier : /etc/bind/named.conf.local
zone "groupe5.org" in {
type master;
file "/etc/bind/db.groupe5.org";
allow-update {key rndc-key;};
allow-query { any; };
};
zone "43.168.192.in-addr.arpa" in {
type master;
file "/etc/bind/db.192";
allow-update {key rndc-key;};
allow-query { any; };
};
## /etc/bind/named.conf.default-zones
/ 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";
};
Inutile de les redonner, ils sont déjà dans le message initial. Et comme je disais, pas de zone db.groupe5.org. db.groupe5.org est un fichier de zone, pas une zone.
si j’ai crée le fichier /etc/bind/db.groupe5.org dans /etc/bind
root@groupe5-srv-dns:/home/magir# cd /etc/bind
root@groupe5-srv-dns:/etc/bind# ls
bind.keys db.192 db.groupe5.org named.conf named.conf.options rndc.key
db.0 db.255 db.local named.conf.default-zones named.conf.options.save zones.rfc1918
db.127 db.empty db.root named.conf.local rndc.conf
root@groupe5-srv-dns:/etc/bind#
Un fichier n’est pas une zone. Tu comprends la différence entre une zone et un fichier de zone ?
ok. Comment le créer. Je ne comprends pas la différence