added dhclient update hook
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
This commit is contained in:
parent
61444179b9
commit
46313724b1
1 changed files with 14 additions and 0 deletions
14
bash/dhclient-exit-hook-nsupdate.sh
Normal file
14
bash/dhclient-exit-hook-nsupdate.sh
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/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
|
Loading…
Add table
Reference in a new issue