Add this file to /etc/dhcp/dhclient-exit-hooks.d/nsupdate to update your dns autmatically when you get a new DHCP/IP lease from your ISP
14 lines
363 B
Bash
14 lines
363 B
Bash
#!/bin/bash
|
|
|
|
NS=/usr/local/bin/nsupdate.sh
|
|
key=/etc/bind/dhcp.key
|
|
zone=0l.de
|
|
host=wg.0l.de
|
|
server=127.0.0.1
|
|
|
|
case $reason in
|
|
BOUND|RENEW|REBIND|TIMEOUT)
|
|
$NS update -d $new_ip_address -k $key -z $zone -n $server -i $interface $host ;;
|
|
RELEASE)
|
|
$NS delete -d $old_ip_address -k $key -z $zone -n $server $host ;;
|
|
esac
|