My Pi cannot resolve hostnames of other services in the same local network. Resolution of external services works fine.
$ nslookup example.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: example.com
Address: 93.184.216.34
Name: example.com
Address: 2606:2800:220:1:248:1893:25c8:1946
For example there's a host thesource.local
that I connect to from my e.g. MacBook but name resolution from the Pi fails:
$ avahi-browse -a|grep SSH
+ eth0 IPv6 thesource SSH Remote Terminal local
+ eth0 IPv4 thesource SSH Remote Terminal local
$ ssh [email protected]
ssh: Could not resolve hostname thesource.local: Name or service not known
This is strictly an issue with local names on the Pi. Connecting from other hosts (e.g. the MacBook) to the Pi using ssh [email protected]
works just fine (thanks to Bonjour/Avahi I guess).
My /etc/dhcpcd.conf
looks like so as I need a static IP address:
interface eth0
static ip_address=192.168.0.10/24
static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 9.9.9.9 2620:fe::fe
For the sake of completeness here's the (abbreviated) ipconfig
output:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::8aa2:f238:cae7:82f3 prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:0f:cd:a4 txqueuelen 1000 (Ethernet)
Update 2020-03-29
More information asked for in the comments:
$ grep -v "#" /etc/avahi/avahi-daemon.conf|grep -v "\["
use-ipv4=yes
use-ipv6=yes
ratelimit-interval-usec=1000000
ratelimit-burst=1000
enable-wide-area=yes
publish-hinfo=no
publish-workstation=no
$ 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 Sat 2020-03-28 19:46:11 CET; 17h ago
Main PID: 329 (avahi-daemon)
Status: "avahi-daemon 0.7 starting up."
Tasks: 2 (limit: 4616)
Memory: 1.2M
CGroup: /system.slice/avahi-daemon.service
├─329 avahi-daemon: running [white-rose.local]
└─340 avahi-daemon: chroot helper
thesource.local
..local
?avahi-browse
obviously findsthesource
... If so this may be a matter of that getting appended on the Mac..local
. The local "domain" is also listed in the last column of the Avahi browser output. However, you make me think that it would probably be more reasonable to expectthesource
to work rather thanthesource.local
. That latter is the mDNS/Bonjour/ZeroConf name that SSH/ICMP/etc. on the Pi probably are not aware of?