mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 10:38:41 -04:00
Feature request: Add Linode as a DNS provider #87
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AnujRNair on GitHub (Jan 15, 2021).
Originally assigned to: @qdm12 on GitHub.
What's the feature?
Please add Linode as a DNS provider
Extra information?
personalAccessToken- it will be 64 chars. Assign it thedomainpermissionsdomainIdandrecordIdfor the A record you want to update. I did this by inspecting the network tab as I manually updated the record. They will both be integersPUTrequest to update the record when your IP changes. Here is the JS to do so:On success, a JSON response with the updated A record will be returned to you.
Thanks so much!
@qdm12 commented on GitHub (Jan 17, 2021):
Hey there, can you please try with
qmcgaw/ddns-updater:linode? The documentation is here, together with the readme.md.I went the long route for some reason. You should just have to specify your
domain,hostandtoken. If you A/AAAA record does not exist, it even creates it automagically. It does a bunch of API calls here and there to find your domain ID and record ID from your domain name.It's not tested though, so it might not work the first time 😉
@AnujRNair commented on GitHub (Jan 17, 2021):
Thanks for the quick add!
I deployed the image and it properly detected my current settings, which is great!
I haven't tried deploying the image when no entry exists to see if it properly adds a new entry, and my current IP has yet to expire so I have yet to test the update, but so far so good.
I can force changes in my config if you'd like to test these 2 use cases before merging in?
Thanks again!
@qdm12 commented on GitHub (Jan 17, 2021):
Yes that would be appreciated! 🎖️ And also thanks for the PR review!
You can set your A record to
127.0.0.1on the web ui and see if the updater picks up the difference. Give it a few minutes eventually for your web ui changes to propagate.And you can remove the A record and see if the updater creates it on its update period. But don't worry too much if that's troublesome, we can just 'assume' it works and someone can create an issue if it doesn't. It's also related to #129 which is not supported for all the other DNS for now.
@AnujRNair commented on GitHub (Jan 17, 2021):
I updated my A record in the Linode manager to point to 127.0.01, and an hour later, the record still hasn't been updated back.
Config from docker compose:
Logs:
Any more info you need from me?
@qdm12 commented on GitHub (Jan 17, 2021):
🤔 Strange what do you get with
nslookup yourdomain.com? Is it the same IP address you set on the UI? It's strange it doesn't show any error. And I presume the web ui says it succeeded?@AnujRNair commented on GitHub (Jan 17, 2021):
Just saw a new error come through on the dashboard:
@qdm12 commented on GitHub (Jan 17, 2021):
That error totally makes sense, silly me. By the way is the error not showing the Docker logs as well? 🤔
Anyway, I just pushed a fix in
7aac7efc6dthe image is now updated (only foramd64let me know if you need another CPU arch). You can pull and retry, thanks for testing!@AnujRNair commented on GitHub (Jan 18, 2021):
Yup, that's updating the A record properly now, thanks!It's not :( see belowI did eventually get errors in the docker log, but one of the values was off:
The provider is listed as luadns even though I've set linode as my provider
@AnujRNair commented on GitHub (Jan 18, 2021):
Ahh, actually the DDNS UI is saying that the A record has been updated, but the record is not actually updated in Linode
Maybe because the provider is luadns?
@AnujRNair commented on GitHub (Jan 18, 2021):
Sorry, one more thing I spotted - I set my config in docker-compose to check my IP address every 15 mins, but it looks like it is being checked every 1 min?
My docker-compose config is in a comment above
After attempting to set the new IP, I also didn't get a cool down of 10m as set in my config above
@qdm12 commented on GitHub (Jan 18, 2021):
That's just an error in the display as you pointed out in the code review 😉 I fixed it.
That is just the healthcheck doing:
It doesn't do an update. Although now that you're saying it, making it quieter would be an idea too.
I pushed some additional commits which:
Please
docker pull qmcgaw/ddns-updater:linodeagain and let me know at what step if fails, thanks!@AnujRNair commented on GitHub (Jan 18, 2021):
I realized this morning what happened - the A record for my main domain got updated instead of the sub domain that I wanted to be updated
I have a domain entry for example.com (domain id 123)
Within this entry I have A records for example.com (record id 456) and (subdomain.example.com ( record id 789)
The record id for 456 was updated when 789 should have been updated!
@qdm12 commented on GitHub (Jan 18, 2021):
Oh ok, I think I might had forgotten to filter records with the host in my code... God I need more unit testing but my weekend coding is lazy 😄 I'll fix it this evening, thanks for your patience!
@AnujRNair commented on GitHub (Jan 18, 2021):
Thanks!
Im also curious:
Why do the lookup if we're not going to act on this info? Couldn't we limit the lookup to once every "x configured" minutes and act on it then if something has changed?
@qdm12 commented on GitHub (Jan 18, 2021):
Alright it's now fixed, indeed I forgot to filter on the host.
About the healthcheck, it only:
And these two operations are 'free' (= you won't get banned), so it runs every 60 seconds.
The 'update' mechanism related with the
PERIODis not free and does:Now if the healthcheck fails, that's essentially to let the user know something's wrong with for example the authentication etc. You can also configure your container to restart when being unhealthy for example.
On the other hand, I removed the
unhealthy: ...logs as you're right, they don't add anything really and spam the logs. One can just check the Docker healthcheck status to know what's wrong. And we can't really do something if it's unhealthy to avoid getting banned for trying too many times.@AnujRNair commented on GitHub (Jan 19, 2021):
ok that makes sense, thanks for the explanation!
Just tested the updater, and the IP updater is now working as expected. I changed the IP on Linode to 127.0.0.1, recreated the ddns container, and it correctly updated it to my current IP address, with the correct logs in
docker logsHowever, when I stopped the container, removed my A record and started the container again, it didn't create the A record from scratch. Nothing in docker logs.
Maybe because of the cooldown period? Or maybe the DNS has been cached. Either way, I'll leave the container running for another hour to see if the A record is recreated.
On another minor minor note, the docker logs have a variable in them - not sure if it's because this is a separate build away from
master:@AnujRNair commented on GitHub (Jan 19, 2021):
Looks like it detects that the record is missing, and tries creating it, but nothing has appeared in my admin panel. No other logs underneath either. I'm also not sure where the 127.0.0.1 has come from, since the record doesn't exist at all - maybe a default value?
On the ddns webpage, the status has been set as
SUCCESS (changed to ***), some time ago@qdm12 commented on GitHub (Jan 19, 2021):
Normally it doesn't log anything except if there is an error or warning. However, for now I just check we get a
HTTP 200 OKstatus code. I pushed some commits to do additional response processing to check it actually succeeded, maybe the status code check is not enough. Can you try pulling, running and checking the logs again? I also added a debug log with parts of the response received when a record is created. Thanks!Yes that could be why you still see
127.0.0.1as it takes a few minutes for the changes to propagate on all DNS servers. It could also be a default value, although that's more unlikely.Well that is definitely useful, I already had that mistake in 4 repositories and was about to add it to like 10 more 😄 Thanks!!
@AnujRNair commented on GitHub (Jan 19, 2021):
This is the new line I see in my logs now!
@qdm12 commented on GitHub (Jan 19, 2021):
Can yoi the try again? Newer image should print the json received 🤔
@AnujRNair commented on GitHub (Jan 20, 2021):
There were a few other MX and TXT records which I've removed.
I've replaced any real domain with *** and any numbers with incrementing numbers (i.e. 216.58.195.78 with 1.2.3.4 etc.)
@qdm12 commented on GitHub (Jan 20, 2021):
Oh god, silly me... That's what happens when you copy pasta! Should be fixed now I think.
@AnujRNair commented on GitHub (Jan 20, 2021):
That did it! A record was created from scratch and the correct JSON payload was received back :)
I think that concludes all of the possible combos of how to create and update the A Record - thanks for adding Linode as a provider!
@qdm12 commented on GitHub (Jan 20, 2021):
Great! Merging in
master/:latest. I'll do another release / Docker tag too for it.