diff --git a/ddns.sh b/ddns.sh index 2a322f7..5a72849 100755 --- a/ddns.sh +++ b/ddns.sh @@ -1,5 +1,12 @@ #!/bin/bash +# The DNS-server IP to use for checking the domain->IP mapping +# If the local system has it's own DNS server which maps IPs differently +# this should point to an external DNS like 1.1.1.1 +NAMESERVER="1.1.1.1" + +# ----- END CONFIG ------------------------------- + SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" DOMAIN="$1" @@ -20,7 +27,7 @@ if [[ "${PROBE_DOMAIN}" == \*.* ]]; then PROBE_DOMAIN="probe.${PROBE_DOMAIN:2}" echo "Probe domain is ----------> ${PROBE_DOMAIN}" fi -DNS_IP=$(dig +short ${PROBE_DOMAIN}) +DNS_IP=$(dig @${NAMESERVER} +short ${PROBE_DOMAIN}) echo "Current DNS-IP -----------> ${DNS_IP}"