Hi,
I want to lookup host names (I mean, to get the IP address from a host name) from a snap core machine (say, named raspi
). I don’t want to setup local DNS server, so I want to use avahi-daemon.
I installed the avahi snap package into raspi
and it works. Now I can access raspi
from remote machine by its hostname as:
remote: $ ping raspi.local
PING raspi.local (192.168.2.2) 56(84) bytes of data.
64 bytes from 192.168.2.2: icmp_seq=1 ttl=64 time=17.3 ms
However, I cannot access the remote machine FROM raspi
:
raspi: $ ping remote.local
ping: unknown host remote.local
I’m sure avahi-daemon is running in the remote machine.
How can I resolve host name from the snap core machine using avahi?
I know the file ‘/etc/nsswitch.conf’ in raspi
controls the order to resolve host name.
The file is:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat extrausers
group: compat extrausers
shadow: compat extrausers
gshadow: files
hosts: files dns myhostname
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
I think it needs some setting to use mDNS, like:
hosts: files mdns4_minimal dns myhostname
but I cannot edit the file on the core package.
Is there any way to edit this configuration file in the core package?
Thank you,