Automated DNS for Tailscale

I’ve been playing with Wireguard for a bit now, and though the core tech has been lovely, he management has gone from non-existent (bare Wireguard) to “oh, this is better” (Algo) to “ooh, this is quite nice!” with the likes of Tailscale. I haven’t played with Pritunl Zero yet, but for the moment I do like not having to run anything myself.

Now, Tailscale has its “Magic DNS”, but for those of us who are on and off of corporate VPNs all day, having to use a fixed nameserver is a non-starter. Tailscale allows you to turn this on and off, but that seems like more hassle than I want to manage.

So, I whipped-up a small script script to fetch all the hosts in my Tailscale network and give them records in my DNS, which I host in AWS Route53. It’ll add and/or update records as necessary.

$ ./update_ts_dns.py –domain jermops.com –zone-id Z080386NOPENOPENOPE
Need to add haloy.jermops.com.
Need to add prod-webapp-a1-py3.jermops.com.
prusa.jermops.com. exists, but ips don’t match r53 100.67.128.0 vs ts 100.67.128.56
Need to add diggery.jermops.com.
zephyr.jermops.com. is correct

You can grab it via this gist. Enjoy!

One comment

  1. Ken Price's avatar
    Ken Price · January 30, 2021

    What language are we speaking here?

    Regards, – KP 😷

Leave a comment