Skip to content

A small DNS serve that serves records for all the machines in your Tailscale tailnet

License

Notifications You must be signed in to change notification settings

giodamelio/tailscale-custom-domain-dns

Repository files navigation

Tailscale Custom Domain DNS

Latest Release Go Report Card Dependabot Status Open Issues License

A tiny DNS server that fetches your list of Tailscale machines and serves records for them on any domain you want.

Why

I love using Tailscale for all my devices, but I am paranoid about configuring my services to use the *.ts.net domain given to me by Tailscale in case I ever need to migrate away from Tailscale.

This small DNS server reads the list of all your Tailscale devices and returns A and AAAA records as subdomains on an arbitrary domain you specify.

Install

  • Download the latest release from Github
  • Install via Docker from GHCR: $ docker pull ghcr.io/giodamelio/tailscale-custom-domain-dns:0.1.0
  • Install with Golang cli: go install github.com/giodamelio/tailscale-custom-domain-dns
  • Clone and build from repo: git clone https://github.com/giodamelio/tailscale-custom-domain-dns.git

Configuration

For docs on all the config optons, see the example config file

Environment variables

The config file can be overridden with environment variables. They all have the prefix TSDNS. Nested options are seperated by underscores and dashes are removed. For example:

[dns-server]
port = 2222

# becomes

$ export TSDNS_DNSSERVER_PORT=2222

Possible Future Enhancements

  • Webhook endpoint allowing automatic refreshing of devices when a new device is added
  • LetsEncrypt DNS-01 Challenge integration
  • Config based static records/aliases
  • Simple web ui listing status
  • Status url for Prometheus or monitoring

About

A small DNS serve that serves records for all the machines in your Tailscale tailnet

Resources

License

Stars

Watchers

Forks