*naïve* static IPs create 3 problems: first, if I do this and then forget about it for a year, then move one of these adapters to a different network, it will mysteriously just not work at all and require debugging. I really don't want to be bothered with that. second, it basically breaks IPv6 completely. third, there are weird issues with moving devices and confusing the arp cache if you send any traffic within 2XMSL which is just a big bummer of a bug magnet.
but this problem is, as all technical problems are, ultimately about *DNS*. While it is *annoying* that the Unifi UI thinks that an ethernet hardware address "has a hostname", the fundamental issue is really just about being able to create DNS records. so, uh, can I create DNS records?
Turns out: yes!
A lot of my Unifi network knowledge is out of date because I _exhaustively_ learned about its featureset in 2020, when I first got all this stuff, but they've been quietly upgrading all the time.
In 2025 they added a more or less full-featured internal DNS service with an API and everything. But, of course, it's Unifi, so a DNS record is a type of "policy". Like you know how a CNAME is basically the same thing as a firewall rule? Like that.
https://help.ui.com/hc/en-us/articles/15179064940439-UniFi-DNS-Records-and-Local-Hostnames
The internal API docs that it sends you to are totally wrong and claim that it only supports individual IPv4 records in the API, but today I found the _actual_ API docs which show all the different record types that I'd experimentally figured out I can add https://developer.ui.com/network/v10.4.57/creatednspolicy
So, please enjoy my janktastic solution:
- I will provision an internal VLAN with dedicated static ranges for both IPv4 and IPv6.
- For each (computer, dock) tuple, I will provision a static IP, and configure a virtual interface with those static IPs
- I will then put in a DNS record for each of those static IPs for the same hostname
- Happy Eyeballs figures out which one is currently connected, and voila, I can connect to whichever device wherever I am
@glyph My god.
Honest question: since you're doing custom DNS records anyway, is this easier than a Wireguard-based solution like Netbird? Or raw WG, but Netbird makes a lot of the annoying stuff easy-peasy.
This could very well not to be your liking; this is just an area I've explored deeply in one direction and always avoided Unifi stuff.
depending on the unifi controller it may have wireguard built in.
i am not out of hone network so i can't test it at the moment but i am 99% sure mdns works over it. ie if i am remote and connected to the vpn i can access 'flynne.local' by name