Dynamically Naming Servers
When provisioning new containers or virtual machines, I let my Ubiquiti router's DHCP server assign IP addresses. However, this can lead to issues when moving the subnet range, resulting in the need to update IP addresses manually. When a DHCP reservation drops, the machine's IP changes, which may go unnoticed until it's needed.
I ultimately decided to move everything to a Tailscale Tailnet, but still wanted to use services on my LAN without relying on Tailscale or its issues. My partner uses their devices with Tailscale intermittently and would like to access some services without toggling it on. To address these problems, I decided to create a dynamic DNS server using ed25519 keypairs for authentication.
This server would allow machines to register and update their hostname records with the desired IP addresses. The server would use a SQLite database, TCP and UDP handlers, and a simple HTTP endpoint for managing new hosts and IP updates. Approved hosts would have their records served automatically, while others would require manual approval.
After implementing this solution, I connected my Unbound instances to the running server and have been using it to manage my home network's DNS records.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.