Closed ktonini closed 5 years ago
This sounds like the new IP address isn't being found correctly (possibly because dig
isn't returning the correct data).
1) Please can you confirm that the output coming from dig
is correct when you run it manually, and also confirm the return code (the first of these commands should show your public IP address, and the second should be 0:
$ dig +short myip.opendns.com @resolver1.opendns.com
$ echo $?
2) Does the script work if you pass the IP address on the command line (i.e. using -i 1.2.3.4
where 1.2.3.4
is your IP address)?
I was having the same problem and ended up changing the command.
From:
IP=$(eval "dig +short myip.opendns.com @resolver1.opendns.com")
To:
IP=$(eval "wget http://ipecho.net/plain -O- -q")
@Impulse0022 Can you run
$ dig +short myip.opendns.com @resolver1.opendns.com
$ echo $?
and report the output? It would be useful to get this to try and figure out why this is failing. Thanks!
I'm going to close this issue as there's not really enough information to help debug this. If anyone does still have this issue, please follow my suggestions above to give more debugging information. Thanks!
I've been using this flawlessly for a couple years now but just recently the script has started throwing an error and not re-adding the A record.
First, when the A record is initially deleted by the script -
success
record_removederror
invalid_value too shortFATAL ERROR: Failed to add new record
And then subsequently
error
no_valueUnable to delete existing record
error
invalid_value too shortFATAL ERROR: Failed to add new record
Manually adding the A record back produces the first error again. Any ideas?
Thanks!