You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
594 B

#!/bin/sh
#
# This script provides support for dynamic DNS update in Microsoft Azure
# cloud. To enable this feature, change the configuration variables below
# and make the script executable.
primary_interface="eth0"
required_domain="mydomain.local"
dns_server="my-dns-server.mydomain.local"
# change the configuration variables above
[ "$interface" == "$primary_interface" ] || exit
case "$reason" in
BOUND|RENEW|REBIND|REBOOT)
fqdn="`hostname`.$required_domain"
nsupdate <<EOF
server $dns_server
update delete $fqdn a
update add $fqdn 3600 a $new_ip_address
send
EOF
;;
esac