0

I have a Mac mini that I'm using as a Homebridge server. It's connected with fixed Ethernet and also has an active WiFi connection.

The Mac mini has an assigned host name Jupiter (from 'Sharing' settings) and the router (a Ubiquiti UDM) has assigned localdomain as a local search suffix (although the host resolves using local and also without any suffix).

I am using the server's assigned hostname (jupiter.local) in the Homebridge configuration, which means this is the address used by Apple HomeKit to control devices.

If I ping the host name from another machine on the same network and subnet, the local IP to which it resolves is usually the one assigned to the ethernet interface.

However, when I had problems with Homebridge devices not responding, I found that this coincided with that hostname resolving to the I.P. attached to the WiFi interface.

Of course, I could simply disable WiFi and this would likely solve my problem. But I'm curious to understand what determines which of the network interfaces' I.P. address is returned when another device on the same network attempts to resolve the local hostname.

My knowledge of DNS on a local network is shaky. Is this configuration of the server device, or the DNS service on the router, or both?

1
  • Having two interfaces on the same subnet isn't advisable especially is using DHCP to configure them because this can wreak havoc with routing tables (like default route) which is probably what you experienced. If you're running a server, these should be statically assigned. As for why the UDM resolved to one address over the other, (I am not familiar with this device), they might be employing a round-robin DNS resolution and they may have weights/priorities assigned to the routes/services/interfaces etc.
    – Allan
    Commented Aug 5, 2023 at 0:09

1 Answer 1

0

The reason why macOS uses the WiFi interface IP address in its mDNS response is hard to say and is implementation-specific. However, if you intend to operate a reasonably stable network, it's advisable to move away from mDNS and shift towards a more robust solution. Here are three options you could consider:

  • Use IP addresses instead of names to address your services/systems
  • Configure static "hostname to IP" mappings in your system's hosts files (e.g., macOS: /etc/hosts, Windows: \Windows\System32\Drivers\etc\hosts)
  • Set up a DNS server that hosts a local domain of your choice and answers all DNS queries as the primary resolver for all your devices

All three options require managing your IP addresses to a greater or lesser extent (either through DHCP MAC bindings on your router or by statically assigning IP addresses to your devices).

PS: While mDNS might seem practical for getting started, it will continually bring you problems. Even for use in a homogeneous home network with only one vendor in place, it is not sufficiently reliable.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .