1

I just added a NAS to my home network and gave it the hostname mynas. I tried to access the NAS from Kubuntu 20.04 (especially via Samba). It works fine when using plain hostname, but it fails when using "mynas.local".

I.e. ping mynas works fine, ping mynas.local does not.

I understand that .local names are resolved using Avahi/Zeroconf (Bonjour). So I run avahi-browse -at which properly locates the NAS. Immediately after that, ping mynas.local works fine – for a minute. Then it stops working until the next avahi-browse -at.

Is this a Kubuntu or a NAS problem? What can I do to permanently enable avahi name resolution?

Please note that the edits below were checked using a new Kubuntu 21.10 installation.

Edit: Content of /etc/nsswitch.conf

passwd:         files systemd
group:          files systemd
shadow:         files
gshadow:        files

hosts:          files mdns4_minimal [NOTFOUND=return] dns
networks:       files

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

netgroup:       nis

Edit2: $ avahi-browse -at

+ enp5s0 IPv6 mynas                    Web-Angebot          local
+ enp5s0 IPv6 mynas                    Microsoft Windows Network local
+ enp5s0 IPv6 mynas                    Device Info          local
+ enp5s0 IPv4 mynas                    Web-Angebot          local
+ enp5s0 IPv4 mynas                    Microsoft Windows Network local
+ enp5s0 IPv4 mynas                    Device Info          local

Edit3: $ systemctl status avahi-daemon.service

avahi-daemon.service - Avahi mDNS/DNS-SD Stack
     Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2021-12-30 23:27:10 CET; 2h 42min ago
TriggeredBy: avahi-daemon.socket
   Main PID: 46832 (avahi-daemon)
     Status: "avahi-daemon 0.8 starting up."

BTW the error I get on ping to mynas.local is "Temporary failure in name resolution"

6
  • It is a user problem ... you probably haven't defined mynas.local anywhere.
    – Soren A
    Dec 7, 2021 at 23:35
  • So I have to explictely choose between mynas and mynas.local as a hostname? Well, if I choose "mynas" how can mynas.local ever work? Dec 8, 2021 at 0:30
  • I guess that you have defined mynas in /etc/hosts as xxx.xxx.xxx.xxx mynas. Add mysql.local kike this xxx.xxx.xxx.xxx mynas mynas.local. If you have defined the host-name in other ways (like in DNS) there are similar ways to define host-name aliases.
    – Soren A
    Dec 8, 2021 at 6:14
  • Didn't do anything like that. I only set the name of the NAS in two places: The hostname and the domain name. There is a description of the domain name that says "If you set a NetBIOS name like synologynas you will be able to access the device in your local network using a URL like https://synologynas.local". This implies that I do not need to add the .local explicitly. Dec 8, 2021 at 21:55
  • @Silicomancer seems alright, when the ping fails before running avahi-browse , check if avahi daemon is running fine, using systemctl status avahi-daemon.service
    – user.dz
    Dec 30, 2021 at 23:16

0

You must log in to answer this question.

Browse other questions tagged .