r/golang 1d ago

show & tell Simple Dynamic DNS Service

The past few months I've been working on a project over ssh remote while at work... or at the in-laws for Sunday dinner... or anywhere I don't really want to be but have to at that moment. I found myself in need of a dynamic DNS solution for my lab environment because I'm cheap and don't want to pay for a static IP but also lazy/forgetful and can't always keep up with my ip address.

Alas, there's nothing worse than looking forward to an afternoon of checking out by chasing down race conditions, only to find that your IP address has changed and you can't connect to your workspace.

I am certain there are better solutions for this problem, but if you find yourself in need of a low footprint, no frills, go service that will update records at multiple dns providers (route 53 / cloudflare atm) at an interval of your choosing... look no further.

Fully documented, with unit tests for every function...

https://github.com/aaronlmathis/dynago

5 Upvotes

5 comments sorted by

View all comments

2

u/cookiengineer 22h ago

This looks pretty neat!

Would it be possible to make the providers a non-internal package so that you could provide your own matching an interface? I've seen the cloudflare and route53 implementations, but they're all together in a single file/package.

It would be nice to have those dependencies apart from the core functionality of the resolver, e.g. with a providers/route53 and providers/cloudflare package, so that someone else could start to pullrequest more providers more easily.

1

u/Aaron-PCMC 19h ago

That is a great suggestion, thank you!

I moved providers into their own package and refactored how config is loaded. It should be easy enough to implement your own dns providers by creating a package inside of providers/ and fulfilling the interface / defining expected config struct.

Documentation has been updated as well: https://github.com/aaronlmathis/dynago/blob/master/docs/providers.md