My native programs (on Fedora) are able to resolve mDNS / Avahi / zeroconf names, like so:
$ ping felonyspork.local -c 1
PING felonyspork.local (192.168.88.169) 56(84) bytes of data.
64 bytes from 192.168.88.169 (192.168.88.169): icmp_seq=1 ttl=64 time=1.73 ms
--- felonyspork.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.734/1.734/1.734/0.000 ms
$ ssh felonyspork.local
Last login: Mon Apr 25 16:05:34 2022 from 192.168.88.200
$ exit
Connection to felonyspork.local closed.
However, my Nix-installed programs are not:
$ nix-shell -p openssh ssh-tools
[nix-shell:~/src/nixconfig]$ ssh-ping -c 1 felonyspork.local
SSHPING felonyspork.local
--- felonyspork.local ping statistics ---
1 requests transmitted, 0 requests received, 100% request loss
[nix-shell:~/src/nixconfig]$ ssh felonyspork.local
ssh: Could not resolve hostname felonyspork.local: Name or service not known
I have mDNS configured in /etc/nsswitch.conf
:
hosts: files myhostname mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
And avahi-daemon
is running on my system.
How can I get Nix programs to correctly resolve mDNS names? This is especially important, because deploying with Morph requires a working Nix SSH session.