The .local
top-level-domain is unique. Lookups are resolved through mDNS
, which listens on port 5353. The local mDNS
daemon collects information about available network services through this port.
If the local firewall service is not configured to support mDNS
, then the machine will not know about network services advertising as .local
devices. Ideally enabling avahi
would be enough for the firewall to support it, but maybe the nixOS implementation is incomplete, or you have something else overriding it.
Similarly, for the local host to lookup .local
addresses, the name service resolver must be configured to use mDNS
before the traditional lookup path. Again, this should happen automatically with nixOS, but local resolver configuration is complicated enough that accidentally overriding proper .local
lookup seems too likely when configuring other name resolution services.
Most home routers use .lan
as a top-level-domain for devices on the local network, along with the device host name supplied in its DHCP request or manually assigned in the router config. You might find that .lan
just works on your network, as in ping my-other-machine.lan
.
To investigate why .local
is not working, I’d first thoroughly review all network-related bits of the OS config. Often the nixOS module info is insufficient, requiring studying the module source code, Arch Linux Wiki, and the man-pages for the relevant services to understand what each bit is doing and how they might interact. Sometimes also there is useful info available from sudo journalctl -b
and sudo journalctl -f
.