adds config option for external nameserver
This commit is contained in:
9
ddns.sh
9
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}"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user