Closed jfritz closed 4 years ago
Thanks for your feedback, I'll add it.
@jfritz Please try this version https://github.com/TimothyYe/godns/releases/tag/V1.9.2 You can set the user agent via the configuration now.
Alright, the user agent was probably an issue, but I dug deeper (since it still wasn't working) and found another problem (which I hope is probably the last/root cause issue). Sorry for all the hassle here.
The username:password
need to be provided via HTTP Basic Auth, not as query string parameters or POST data as the code is currently doing. Below is an example from the Google Domains API documentation.
Tl;dr - this might be as simple as using req.SetBasicAuth(username, password)
and removing the values.Add("username:password", ...)
.
@jfritz Really appreciate with your feedback. I don't have a Google domain account since it is not supported in my country. You may try this version: https://github.com/TimothyYe/godns/releases/tag/V1.9.3
Hi @jfritz , is this issue fixed already? I plan to close this issue...
Hi @TimothyYe, have you confirmed with any test users that Google DNS Update is working?
I'm getting the following feedback in a Windows environment:
` E:\Repositories\godns-2.1>godns.exe
[GoDNS] 2020/04/22 16:09:23 GoDNS started, entering main loop... [GoDNS] 2020/04/22 16:09:23 Creating DNS handler with provider: Google [GoDNS] 2020/04/22 16:09:24 currentIP is: CENSORED [GoDNS] 2020/04/22 16:09:24 CENSORED Start to update record IP... [GoDNS] 2020/04/22 16:09:24 Update IP success: notfqdn [GoDNS] 2020/04/22 16:09:24 Going to sleep, will start next checking in 21600 seconds... `
However, updating manually in the browser works
https://CENSORED:CENSORED@domains.google.com/nic/update?hostname=CENSORED.com&myip=CENSORED
@hemming1 Hmmm, Google Domain is unavailable in my country, however, I'll find a way to register an account and try to reproduce this issue.
@jfritz Were you able to get your domain ip to update successfully?
I ultimately I ran into crunch time at work and it prevented me from debugging the issue further. I did get the direct web request updates to work as you mentioned earlier.
On Thu, Apr 23, 2020, 11:07 AM Brad Hemmingsen notifications@github.com wrote:
@jfritz https://github.com/jfritz Were you able to get your domain ip to update successfully?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TimothyYe/godns/issues/46#issuecomment-618489051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABCAQ5YL5FFK2KOGRYTZBLROBRVNANCNFSM4ISR6WSQ .
@TimothyYe would it be useful if I setup a temporary domain for you to test on?
@BradHemmingsen That would be great! Thanks!
@BradHemmingsen Now I get another error, it seems that DDNS is not enabled for this temporary domain. Would you pls help to enable it?
nohost - The hostname does not exist, or does not have Dynamic DNS enabled.
@BradHemmingsen Issue has been fixed, pls try this pre-release version: https://github.com/TimothyYe/godns/releases/tag/V2.1.1
godns 1.9.1 doesn't seem to successfully update my ddns with Google. The messaging looks successful:
however, checking Google Domains, the last update for my DNS was stated to be months ago.
To check, I made the request directly via a browser to the end point using the same config/username/password/domain, and this successfully updated my ddns IP.
https://CENSORED:CENSORED@domains.google.com/nic/update?hostname=CENSORED.net&myip=CENSORED
I noticed that
UpdateIP()
in the Google handler does not set a user agent when sending the request to the Google API endpoint. Per Google's API documentation, you should set a user agent when updating DNS: "Note: You must set a user agent in your request as well. Web browsers will generally add this for you when testing via the above url."Note the user agent might be required for other services as well, as it is one of the few things public API endpoints can use to ban "bad" bots who improperly use APIs without actually banning specific IPs directly - not saying this is the case here, but just noting in general.
Edit: is there a way I can set user agent via the configuration?