Ubuntu avahi-daemon cannot find "raspberrypi.local"

6,616

I solved it for my Raspberry Pi Zero W the following way:

Network Manager menu -> Edit Connections, edit the new Ethernet connection (for me it was "Wired connection 2"). IPv6 Settings -> Method -> Link-Local Only.

Network Manager should now be able to establish the connection.

$ ifconfig
enp0s20f0u1 Link encap:Ethernet  HWaddr 8a:dd:a1:c0:72:c0  
          inet6 addr: fe80::2f6d:7bde:ad10:d2a7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:165 errors:0 dropped:0 overruns:0 frame:0
          TX packets:493 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:30167 (30.1 KB)  TX bytes:81949 (81.9 KB)

Check if avahi-daemon has detected the new device by running:

$ avahi-resolve-host-name raspberrypi.local
raspberrypi.local   fe80::c813:143e:4bf0:7607

And then:

$ ssh -6 pi@fe80::c813:143e:4bf0:7607%enp0s20f0u1
Linux raspberrypi 4.9.59+ #1047 Sun Oct 29 11:47:10 GMT 2017 armv6l
...

Unfortunately, the simple hostname resolution way does not work:

$ ssh -6 [email protected]
ssh: Could not resolve hostname raspberrypi.local: Name or service not known

Thanks for quantenProjects comment here.

Share:
6,616
Anthony Dellinger
Author by

Anthony Dellinger

Updated on September 18, 2022

Comments

  • Anthony Dellinger
    Anthony Dellinger over 1 year

    I am using a ubuntu 16.04 LTS laptop. I have a raspberry pi zero I flashed raspbian onto. I enabled ssh on the raspberry pi, and set it up as an ethernet gadget so I can ssh into it from a micro-usb connection. I can ssh into the pi from my friends macbook, so the raspberry software is configured correctly.

    The avahi daemon is up and running:

    $ sudo service avahi-daemon status
    ● 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 2018-01-04 14:22:11 EST; 42min ago
     Main PID: 4114 (avahi-daemon)
       Status: "avahi-daemon 0.6.32-rc starting up."
       CGroup: /system.slice/avahi-daemon.service
               ├─4114 avahi-daemon: running [vivobook.local
               └─4122 avahi-daemon: chroot helpe
    
    Jan 04 14:44:16 vivobook avahi-daemon[4114]: Interface wlp2s0.IPv6 no longer relevant for mDNS.
    Jan 04 14:44:16 vivobook avahi-daemon[4114]: Withdrawing address record for 172.18.94.241 on wlp2s0.
    Jan 04 14:44:16 vivobook avahi-daemon[4114]: Leaving mDNS multicast group on interface wlp2s0.IPv4 with address 172.18.94.241.
    Jan 04 14:44:16 vivobook avahi-daemon[4114]: Interface wlp2s0.IPv4 no longer relevant for mDNS.
    Jan 04 14:55:22 vivobook avahi-daemon[4114]: Joining mDNS multicast group on interface wlp2s0.IPv4 with address 172.18.94.241.
    Jan 04 14:55:22 vivobook avahi-daemon[4114]: New relevant interface wlp2s0.IPv4 for mDNS.
    Jan 04 14:55:22 vivobook avahi-daemon[4114]: Registering new address record for 172.18.94.241 on wlp2s0.IPv4.
    Jan 04 14:55:24 vivobook avahi-daemon[4114]: Joining mDNS multicast group on interface wlp2s0.IPv6 with address fe80::fc9:a526:6f49:7e33.
    Jan 04 14:55:24 vivobook avahi-daemon[4114]: New relevant interface wlp2s0.IPv6 for mDNS.
    Jan 04 14:55:24 vivobook avahi-daemon[4114]: Registering new address record for fe80::fc9:a526:6f49:7e33 on wlp2s0.*.
    

    But I can not ping raspberrypi.local or raspberry.local.

    I don't know what that 172.18.94.241 address is, but I can ping it but not ssh it, so I don't think it's the pi.

    ifconfig does not show a raspberry pi connection:

    sudo ifconfig
    docker0   Link encap:Ethernet  HWaddr 02:42:ae:ef:4b:aa  
              inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:18973 errors:0 dropped:0 overruns:0 frame:0
              TX packets:18973 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:14786295 (14.7 MB)  TX bytes:14786295 (14.7 MB)
    
    wlp2s0    Link encap:Ethernet  HWaddr 7c:5c:f8:b3:46:5b  
              inet addr:172.18.94.241  Bcast:172.18.95.255  Mask:255.255.248.0
              inet6 addr: fe80::fc9:a526:6f49:7e33/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:236543 errors:0 dropped:0 overruns:0 frame:0
              TX packets:26241 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:277975117 (277.9 MB)  TX bytes:4022218 (4.0 MB)
    

    I have tried uninstalling and reinstalling the avahi daemon, but it did not work. What am I doing wrong?

  • Arman Yeghiazaryan
    Arman Yeghiazaryan over 3 years
    I wasn't able to find a proper answer for hours. Thank you! This works for me.