[Help] Advertise Hostname IP for 2 different Interfaces (LAN and Tailscale)
oranki @ oranki @piefed.social Posts 0Comments 22Joined 9 mo. ago
oranki @ oranki @piefed.social
Posts
0
Comments
22
Joined
9 mo. ago
mDNS refers to multicast DNS (.local), while similar you should not mix it up with Tailscale's MagicDNS, which is entirely a Tailscale thing, dependent on their APIs.
mDNS also seems to be what you're after too. For the hostname-only resolution to work, you need to have Avahi or equivalent mDNS daemon running on the hosts, and add
.local
to the search domains. Setting search domains can be done manually on each host or via DHCP network-wide.With mDNS and
.local
in the search domains, when you try e.g.http://myhost/
in the browser, the browser first triesmyhost
, then adds each search domain, e.g.myhost.local
. Since .local is reserved for mDNS, querying it results in an mDNS query in your network, and if there's a device with a matching name, it will respond with it's IP address.Note that if you have Tailscale and MagicDNS active, your tailnet's domain will (or should) be the first one on the search domains list, and your DNS server is set to 100.100.100.100, which is a dummy address on which the tailscale daemon runs the internal DNS server for Tailscale, including MagicDNS.
Multicast DNS / Avahi is a little bit error prone in my experience, but when nothing goes wrong, this would give you what you're looking for.
There are other options, like your router automatically registering DNS entries for DHCP hosts, or running a separate DNS server anf manually adding records for the hosts you need this for.