Access SLOW ".local" - Avahi mDNS

.local

Before adjustment

It’s a simple home network, and I had no problems with connectivity in general, but I was a little disappointed that it took a while for name resolution. “.local” about 5sec.
It was slow only on the local server with self name resolution. delay 5sec.
There were no problems with the client to begin with. iPad/Android/another Linux ↔ Manjaro. very fast.

After adjustment (I’m satisfied with the results)

After reviewing the settings, it was resolved result in less than a second.
I’ll accept this as good for my homework.
That’s the memo. Thanks to archwiki avahi.

eg,nemo,nautilus,samba,… etc…

5.05 secs to 275.88 millis. very fast.

I’m satisfied. Please teach me , I’d be happy if you have any opinions.
Maybe it’ll be useful to someone, or it’ll be an opportunity to reconsider.

memo
❱ time smbclient -L mainserver -U%

        Sharename       Type      Comment
        ---------       ----      -------
        MainTitle       Disk      MainTitle
        CURRENT         Disk      CURRENT
        Public          Disk      public
        SDGs            Disk      sdgs
        IPC$            IPC       IPC Service (SAVAN)
SMB1 disabled -- no workgroup available

________________________________________________________
Executed in   38.42 millis    fish           external

❱ time smbclient -L mainserver.local -U%
________________________________________________________
Executed in    5.05 secs      fish           external

$ avahi-browse --all --ignore-local --resolve --terminate

code /etc/avahi/avahi-daemon.conf

use-ipv4=yes
#ME use-ipv6=yes


$ code /etc/nsswitch.conf

hosts: mymachines mdns4_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] wins files dns myhostname winbind #ME OKOK

editted.

Not sure whether I understood the problem - seems to be working, but too slow.

This is what I remember having read and seen to address that situation:

https://wiki.archlinux.org/title/Avahi#Hostname_resolution

Making sure you're not a bot!

(They are both the same - the Arch Wiki has bot protection now - hence the strange text the link renders here)

Maybe it is what helps your situation …

content:

Then, edit the file /etc/nsswitch.conf and change the hosts line to include mdns_minimal [NOTFOUND=return] before resolve and dns:

hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns

ps:

I just saw that this is already the default in my Manjaro Xfce4 VM - so that was probably not it … :man_shrugging:

querying a .local domain is essentially a broadcast

who has name bob.local

The broadcast is sent to the network broadcast address defined by the netmask e.g. 192.168.1.1/24 has 192.168.1.255 as broadcast address and the sender await a response.

The device with the name is responding to the broadcast address

ip.x.y.z has name bob.local

The package nss-mdns is an optional requirement for avahi - which in turn is required by NetworkManager and thus the package may not be synced to your system.

The avahi daemons may not be enabled so to get a fully functional zeroconf you may need sync an extra package and enable services as required.

 $ pamac search mdns --no-aur | grep Installed
nss-mdns  0.15.1-2 [Installed]                               extra
 $ systemctl list-unit-files | grep avahi
avahi-daemon.service                      enabled         disabled
avahi-dnsconfd.service                    enabled         disabled
avahi-daemon.socket                       enabled         disabled
 $ cat /etc/nsswitch.conf
# Name Service Switch configuration file.
# See nsswitch.conf(5) for details.

passwd: files systemd
group: files [SUCCESS=merge] systemd
shadow: files systemd
gshadow: files systemd

publickey: files

hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns
networks: files

protocols: files
services: files
ethers: files
rpc: files

netgroup: files
 $ ping -c 3 pihole.local
PING pihole.local (172.30.30.2) 56(84) bytes of data.
64 bytes from pihole.local (172.30.30.2): icmp_seq=1 ttl=64 time=0.278 ms
64 bytes from pihole.local (172.30.30.2): icmp_seq=2 ttl=64 time=0.633 ms
64 bytes from pihole.local (172.30.30.2): icmp_seq=3 ttl=64 time=0.296 ms

--- pihole.local ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2048ms
rtt min/avg/max/mdev = 0.278/0.402/0.633/0.163 ms

1 Like

@linux-aarhus @Nachlese

Thank you.
I will carefully refer to your comment next time I have a problem.

  • It seems that some people have been confused, but I had no problems at the time of posting. I was just looking for deep insight. thanks a lot.

edit::20250520

I recently did a fresh install. No tweaking was needed.

My 8 year old Manjaro required some tweaking as outlined in my original post.

Just a note to record this.

Thanks.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.