Raspberry Pi .local Not Working? Check mDNS¶
If SSH works by IP but raspberrypi.local fails, check which name your Pi is actually announcing with multicast DNS (mDNS). A name conflict can also make raspberrypi.local resolve to a different address while your Pi advertises a name such as raspberrypi-2.local.
1. Compare the IP and hostname from your client¶
Use the IP address you already confirmed for your Pi. If you need to find it, check your router's active devices or use a local terminal on the Pi to run ip -brief address. From your client, substitute the username and IP for your setup.
Keep this known-working session open. If the IP connection also fails, start with the headless connection troubleshooter.
On a Linux client, check the hostname using the system resolver. Substitute the name you expected from Raspberry Pi Imager.
Match the returned address against the Pi's addresses on the intended network. You may see the same IP on several lines. A Pi connected both by Ethernet and Wi-Fi can also have more than one address. If the name gives no answer or gives an address you cannot match to your Pi, keep using the verified IP while you check the published name. getent uses the normal Linux resolver path, which can use mDNS when configured. Avahi NSS module documentation
2. Read the name that Avahi actually publishes¶
Run these commands on the Pi through the working IP connection or a local terminal. Raspberry Pi OS uses Avahi to announce its .local name. Raspberry Pi remote access documentation
Here are two lines from a Pi 4B test. The first shows why Avahi selected a different name. The second shows the name it registered.
If Avahi is active and the log lacks a recent startup line, ask the running daemon for its current fully qualified name.
The example returns s "raspberrypi-2.local". On the client, repeat the lookup from step 1 using the published name. In the Pi 4B test, raspberrypi.local returned an address outside the Pi's interfaces. The published raspberrypi-2.local resolved to the known Pi address, and SSH succeeded with the Pi's previously verified host key. Avahi can change its advertised name after a conflict. Avahi's hostname-conflict handling
Once the name maps to your Pi, try it over SSH. If the name is new to the client and SSH asks you to trust a host key, verify the fingerprint before accepting.
3. Fix the remaining cause¶
| What you find | What to check next |
|---|---|
Avahi registered a name ending in -2 or another suffix |
Use the published name now. For a stable name, choose a unique hostname under System Options → Hostname in sudo raspi-config. Check the new advertised name and update saved SSH aliases or scripts that used the old name. Raspberry Pi hostname settings |
| Avahi is inactive or missing | Inspect systemctl status avahi-daemon and its journal on the Pi. If the service is installed and you want the Pi to advertise on this LAN, try sudo systemctl start avahi-daemon and check its status again. |
| The Pi publishes the expected name, but the client has no answer | Try from another mDNS-capable client on the same trusted LAN. Check whether guest Wi-Fi isolation, a VLAN, or the client's resolver prevents multicast discovery. |
The IP works across a VPN or routed network, but .local fails |
Use the verified IP or a name provided by that network's DNS. Standard mDNS is scoped to the local link. |
| SSH warns that a host key changed | Verify the Pi's identity from the working connection or local console before trusting the name. |
Use the system resolver when comparing results with SSH. For example, a lookup sent to a router's unicast DNS server can miss a name published only via mDNS. Multicast DNS specification