Raspberry Pi WiFi Avahi mDNS config

Avahi mDNS allows connecting to the Raspberry Pi and other Avahi-enabled host devices without knowing the host IP address. The default /etc/avahi/avahi-daemon.conf puts mDNS on all active interfaces–including WiFi.

Manual config Avahi interfaces

This procedure is NOT typically needed. Find WLAN adapter name by

ip a

typically named wlan0. Also note the wlan0 IP address for testing if Avahi doesn’t work right away.

Edit /etc/avahi/avahi-daemon.conf to have

allow-interfaces=eth0,wlan0

or whatever interface desired to have Avahi on.

Verify which interfaces and IPv6/IPv6 Avahi is active on from the Avahi host device:

service avahi-daemon status

Test Raspberry Pi Avahi mDNS: from another computer:

ping hostname.local

If that doesn’t work, try using the IP address as found on Avahi host:

ip a

Configure firewall for SSH

Be sure to open the Raspberry Pi ufw firewall port. Port 22 (or other SSH port assigned in /etc/ssh/sshd_config on the Raspberry Pi) should be seen in:

ufw status

If you prefer a Firewall GUI:

apt install gufw

Avahi Diagnostics

Prereqs

apt install avahi-utils mdns-scan

From your laptop (or Pi if diagnosing)

avahi-browse -arp

or

mdns-scan

You should see your device (also try this from your Pi).

SSH security

Use SSH Public Key Authentication with ED25519 keys. Raspberry Pi is trivial to hack like any other device on any operating system if proper cybersecurity is not used. Why do you care if someone hacks your Pi? The hacker can use the Pi’s relatively powerful CPU & GPU to stage sophisticated attacks on the rest of your network.