Avahi-resolve works, but not ping to somehost.local?

New time tumbleweed user struggling to get mdns working. Or rather, mdns/avahi seems to work but not be used for resolving hostnames as shown in the following example. Avahi can resolve e.g. homeassistant.local to correct IP, but it doesn’t work for ping, firefox, etc.

$ avahi-resolve-host-name homeassistant.local
homeassistant.local     fda0:.....63e3
$ ping fda0:.....63e3  # Works fine
$ ping homeassistant.local
ping: homeassistant.local: Name or service not known

mdns_minimal is included in nsswitch. Also tried mdns4_minimal but with same result.

$ cat /etc/nsswitch.conf | grep hosts:
hosts:          files mdns_minimal [NOTFOUND=return] dns

Tumbleweed installed on April 30th. Added mdns to firewall and little else changed.

Any help greatly appreciated!

Do you have the nss-mdns (plugin) package installed?

Yes, nss-mdns-0.15.1-1.7.x86_64 is installed. Must it be enabled somehow?

No, it should be working. You have NSS configured (via nsswitch.conf). Can you ping other Avahi hosts on the network (by name)?

No, not even myownhostname.local.

Are you also using systemd-resolved?

If it is the default, then yes but I am not really sure. The journal log shows

dns-mgr: init: dns=default,systemd-resolved rc-manager=symlink (auto)

I can see the following in the journal log, could it be related to the issue?

21:48:18 tumbler systemd[1]: Started Network Manager Script Dispatcher Service.
21:48:18 tumbler dns-dnsmasq.sh[1041]: <debug> NETWORKMANAGER_DNS_FORWARDER is not set to "dnsmasq" in /etc/sysconfig/network/config -> exit

Have you checked resolved.conf (re 'MulticastDNS=`)?

More info
man resolved.conf

That is not what was asked. Whether NetworkManager is configured to use systemd-resolved as backend is independent of whether your system is configured to actually use it for name resolution.

Spelling nazi here … it’s resolv.conf

dart@windeath:~> cat /etc/resolv.conf 
### /etc/resolv.conf is a symlink to /run/netconfig/resolv.conf
### autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
#     NETCONFIG_DNS_STATIC_SEARCHLIST
#     NETCONFIG_DNS_STATIC_SERVERS
#     NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
#     NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
### Call "netconfig update -f" to force adjusting of /etc/resolv.conf.
nameserver 192.168.1.1``

2nd to last line might be helpful …

No, that is NOT what I was referring to. This relates to systemd-resolved. Refer to the man page I already gave.

dart@windeath:~> man resolved.conf
No manual entry for resolved.conf
Possibly, man page is not installed, try online at: https://manpages.opensuse.org/resolved.conf

I did and not installed on my (admittedly desktop) machine … so maybe they need to install systemd-resolved … I’ll be quiet now

And what is listening on this address?

sudo ss -lnup
windeath:/home/dart # ss -lnup
State      Recv-Q     Send-Q           Local Address:Port            Peer Address:Port     Process                                      
UNCONN     0          0                      0.0.0.0:37334                0.0.0.0:*         users:(("avahi-daemon",pid=1097,fd=13))     
UNCONN     0          0                      0.0.0.0:5353                 0.0.0.0:*         users:(("kdeconnectd",pid=2147,fd=39))      
UNCONN     0          0                      0.0.0.0:5353                 0.0.0.0:*         users:(("avahi-daemon",pid=1097,fd=11))     
UNCONN     0          0                      0.0.0.0:38687                0.0.0.0:*         users:(("kdeconnectd",pid=2147,fd=42))      
UNCONN     0          0                    127.0.0.1:323                  0.0.0.0:*         users:(("chronyd",pid=1419,fd=5))           
UNCONN     0          0                            *:53732                      *:*         users:(("kdeconnectd",pid=2147,fd=43))      
UNCONN     0          0                         [::]:5353                    [::]:*         users:(("avahi-daemon",pid=1097,fd=12))     
UNCONN     0          0                            *:5353                       *:*         users:(("kdeconnectd",pid=2147,fd=40))      
UNCONN     0          0                            *:5353                       *:*         users:(("kdeconnectd",pid=2147,fd=41))      
UNCONN     0          0                         [::]:59035                   [::]:*         users:(("avahi-daemon",pid=1097,fd=14))     
UNCONN     0          0                            *:1716                       *:*         users:(("kdeconnectd",pid=2147,fd=37))      
UNCONN     0          0                        [::1]:323                     [::]:*         users:(("chronyd",pid=1419,fd=6))           

OK, sorry, I got impression that it is the same host. So, DNS resolution bypasses local systemd-resolved even if it is running. Show

grep hosts /usr/etc/nsswitch.conf /etc/nsswitch.conf

No sorry … I’m not the OP … sorry if I caused any noise

Sorry for being off-line for so long and thanks everyone for assisting!

I did not have the systemd-resolved rpm installed initially. I then tried installing it. No change. If I understand correctly than MulticastDNS should already default to yes, but tried setting it explicitly (see below) but still no change.

$ sudo systemd-analyze cat-config systemd/resolved.conf
# /etc/systemd/resolved.conf
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under t>
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file (or a copy of it placed in
# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" >
# the /etc/systemd/resolved.conf.d/ directory. The latter is generally
# recommended. Defaults can be restored by simply deleting the main
# configuration file and all drop-ins located in /etc/.
#
# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full >
#
# See resolved.conf(5) for details.

[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700>
# Google:     8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.>
# Quad9:      9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe>
#DNS=
#FallbackDNS=
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=yes
#LLMNR=yes
#Cache=yes
#CacheFromLocalhost=no
#DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
#StaleRetentionSec=0
MulticastDNS=yes

Ports:

tumbler:~ $ sudo ss -lnup
State    Recv-Q    Send-Q       Local Address:Port        Peer Address:Port   Process
UNCONN   0         0                  0.0.0.0:50838            0.0.0.0:*       users:(("avahi-daemon",pid=904,fd=13))
UNCONN   0         0                127.0.0.1:323              0.0.0.0:*       users:(("chronyd",pid=1147,fd=5))
UNCONN   0         0                  0.0.0.0:5353             0.0.0.0:*       users:(("avahi-daemon",pid=904,fd=11))
UNCONN   0         0                    [::1]:323                 [::]:*       users:(("chronyd",pid=1147,fd=6))
UNCONN   0         0                     [::]:54476               [::]:*       users:(("avahi-daemon",pid=904,fd=14))
UNCONN   0         0                     [::]:5353                [::]:*       users:(("avahi-daemon",pid=904,fd=12))

hosts in /etc/nsswitch.conf (also tried e.g. mdns_minimal and other variants):

hosts:          files mdns4 [NOTFOUND=return] dns

hosts in /usr/etc/nsswitch.conf was

hosts:         files dns

Adding mdns4 did not help either.

Another strange thing: I can’t even ping my own hostname without .local:

$ hostname
tumbler
$ ping tumbler
ping: tumbler: Name or service not known

Other internet hosts works. A mac on the network can ping tumbler.local

I feel very lost right now! What resolver did I have before and did I know switch to a different one by installing the systemd-resolved rpm?

Well, when there is nothing to tell the resolver what domain is to be used, one should provide it oneself. The same as trying to resolve forums instead of forums.opensuse.org .

One can configure a default domain in /etc/resolv.conf with the search statement. See man resolv.conf.

No, that isn’t the issue here. Avahi utilizes the .local domain (by default) for local hostname resolution and service discovery within a local network.