Incorrect hostnames for Raspberry Pi 5 devices
3 posts
I have 20 Raspberry Pi 5s that network boot and have static addresses.
In WiFi Guard, most hostnames ending in 01 to 09 have extra data of -<one digit number> (e.g. -5) added before .local, and for all hostnames ending in 10 to 20, the last 2 digits before .local (e.g. -20) are wrong (10 -> 15, 11 -> 19, 12 -> 25, 13 -> 17, 14 -> 16, 15 -> 18, 16 -> 20, 17 -> 21, 18 -> 23, 19 -> 22 & 20 -> 24).
Restarting WiFi Guard doesn't fix the problem, but rebooting the Raspberry Pis temporarily fixes this problem.
Is this problem due to WiFi Guard, or the Raspberry Pis?
This behaviour isn't caused by WiFi Guard. It's due to how Raspberry Pi devices advertise hostnames via mDNS (Avahi). When a hostname conflict is detected, which can happen during simultaneous network boot or if multiple services announce names, the system automatically alters the hostname (e.g. adding "-5" or changing numbers). WiFi Guard simply displays these announced names.
Rebooting Raspberry Pi temporarily clears the conflicts, which is why the names appear correct again for a while.
To resolve this, please check on the Raspberry Pi side:
- Each device has a unique hostname set before network services start
- Only one mDNS/Avahi service is running
- Optionally stagger boot times or disable mDNS if using static IPs
Fixing the underlying hostname conflicts should eliminate the issue.