So after looking at two articles on how to do so (link1) and (link 2) , I believe I've gotten my Dynamic DNS to update (manually) with wget
.
However; the OpenWRT DDNS program is still acting a little squirrelly.
Here's how I did this manually:
- Started by registering a google domains domain name (see link1)
- After reading a bit in link 2 came up with my own script and configuration for updating the IP of my google domains domain DNS name, see below:
#!/bin/sh
result=$(wget -4 -O- https://$username:$password@domains.google.com/n
echo "$result" | grep -i -e "good|nochg"
logger ddns "DDNS Result: $result"
return 0
- Then, configuring
/etc/config/ddns
(similar to link 2) I have been able to get this thing to update the google domains dns, but ONLY MANUALLY.
config ddns 'global'
option ddns_dateformat '%F %R'
option ddns_loglines '250'
option upd_privateip '0'
config service 'googledomains_ddns_ipv4'
option lookup_host 'host.medomain.com'
option update_script '/etc/ddns/ddns_update.sh'
option domain 'medomain.com'
option username 'meusrname'
opiton password 'mepasswd'
option enabled '1'
But I'm still getting pretty strange log files back that seem to indicate that it didn't work (and they repeat alot):
Tue Jun 2 18:34:36 2020 user.err ddns-scripts[23255]: googledomains_ddns_ipv4: No update send to DDNS Provider
Tue Jun 2 18:44:36 2020 user.warn ddns-scripts[23255]: googledomains_ddns_ipv4: Updating IP at DDNS provider failed - starting retry 114/0
Tue Jun 2 18:44:36 2020 user.err ddns-scripts[23255]: googledomains_ddns_ipv4: No or private or invalid IP 192.168.0.118 given! Please check your configuration
Tue Jun 2 18:44:36 2020 user.err ddns-scripts[23255]: googledomains_ddns_ipv4: No update send to DDNS Provider
Tue Jun 2 18:54:37 2020 user.warn ddns-scripts[23255]: googledomains_ddns_ipv4: Updating IP at DDNS provider failed - starting retry 115/0
Tue Jun 2 18:54:37 2020 user.err ddns-scripts[23255]: googledomains_ddns_ipv4: No or private or invalid IP 192.168.0.118 given! Please check your configuration
Tue Jun 2 18:54:37 2020 user.err ddns-scripts[23255]: googledomains_ddns_ipv4: No update send to DDNS Provider
It looks to me like the log messages aren't even coming from my script...maybe I installed something in luci, I did follow the DDNS page as well and installed dns_scripts thinking initially that it would be the way to go.
When I try this manually it works like this, but the results coming back are still confusing...
wget -4 -O- https://$username:$password@domains.google.com/nic/update?hostname=$lookup_host&myip=$(dig short myip.opendns.com @resolver1.opendns.com)
The string nohost
appears in the prompt after that (maybe it should be good
, instead?), but it also seems to have updated the address; I believe I did it wrong and should have included a +short
instead of just short
above, but any time after that, that I call it again using the correct syntax I get back a HTTP request sent, awaiting response... 401 Unauthorized
even though it updates, and the prompt shows nochg xxx.xxx.xxx.xxx
where xxx.xxx.xxx.xxx
is my current IP address (i.e. it's already been updated).
So I have to wait until it needs updated to try it again. Is there some way to stop the repeating messages in the logs and maybe fix my script so that it works correctly? Also, documentation into the google domains "webservice" I am calling would be useful, if anybody has any, so I can better understand what values are returned.