Outils pour utilisateurs

Outils du site


tech:dynamic_dns_ddns_avec_dhcp

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
tech:dynamic_dns_ddns_avec_dhcp [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:dynamic_dns_ddns_avec_dhcp [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Réseaux DNS DHCP}}
 +
 +# Notes Dynamic DNS DDNS avec DHCP
 +
 +Voir :
 +* https://isrdoc.files.wordpress.com/2010/11/dns-dynamique-combinc3a9-avec-dhcp.pdf
 +
 +
 +## Hack DHCP ne veux pas faire du DDNS sous RedHat 8
 +
 +`/etc/dhcp/dhclient-exit-hooks.d/update-dns.sh`
 +~~~bash
 +#! /bin/bash
 +
 +NAME_FQDN="$(hostname -s).acme.local"
 +IP=$(hostname -I | tr " " "\n" | egrep "192\.168\.1\.")
 +#IP=$(ip a | grep wlan0 | grep "inet " | awk '{print $2}' | cut -d '/' -f 1)
 +
 +if [ ! -z "$IP" ]
 +then
 +nsupdate -k /root/rndc.key <<EOF
 +update del ${NAME_FQDN} A
 +update add ${NAME_FQDN} 86400 A ${IP}
 +send
 +EOF
 +fi
 +~~~
 +
 +~~~bash
 +chmod +x /etc/dhcp/dhclient-exit-hooks.d/update-dns.sh
 +~~~
 +
 +
 +### Ce hack n'est pas nécessaire
 +
 +Il faut avoir le paquet isc-dhcp-client d'installé avec la configuration :
 +
 +`/etc/dhcp/dhclient.conf`
 +~~~bash
 +send host-name = gethostname();
 +~~~
 +
 +
 +## Exemple nsupdate 
 +
 +~~~bash
 +nsupdate -k /etc/rndc.key <<EOF
 +update del plop.acme.local A
 +update add plop.acme.local 86400 A 192.168.1.4
 +show
 +send
 +EOF
 +~~~
 +
 +## Autres
 +
 +Voir : 
 +* https://blog.hqcodeshop.fi/archives/76-Doing-secure-dynamic-DNS-updates-with-BIND.html
 +
 +Vérif syntax
 +~~~bash
 +dhcpd -t -cf /etc/dhcp/dhcpd.conf
 +~~~
 +
 +Rafraichir la conf
 +~~~bash
 +> /var/lib/dhcpd/dhcpd.leases
 +systemctl restart dhcpd
 +~~~
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki