Raspberry Pi vs. Avahi

It turns out that the various Avahi daemons performing the magick between whatever.local names and dotted-quad addresses for Raspberry Pi descend into gibbering madness when confronted with:

  • One name corresponding to multiple IP addresses
  • One IP address used for multiple MAC addresses
  • Multiple names for one IP address
  • Multiple names for one MAC address
  • Multiple IP addresses for one MAC address
  • Multiple MAC addresses for one IP address
  • Any and all combinations of the above at various times

The least of the confusion involved an incorrect IP address linked to a familiar name pulled from deep history by a baffled daemon doing the best it can with what it thinks it knows. Despite what I concluded, rather early in the process, there’s no real error, other than my performing what amounted to a self-inflicted fast-flux nameserver attack.

Anyhow, I devoted the better part of an afternoon to sorting out the mess, which involved labeling all the streaming radio players with their MAC addresses and rebooting them one-by-one to allow all the daemons time to recognize the current situation:

Raspberry Pi 3 - WiFi MAC address
Raspberry Pi 3 – WiFi MAC address

That label corresponds to the Pi 3’s on-board WiFi adapter.

For Pi 2 boxen, the MAC address travels with the WiFi adapter jammed into a USB port:

SunFounder WiFi Adapter - MAC address
SunFounder WiFi Adapter – MAC address

I didn’t label the (unused) Ethernet jacks, figuring I’d solve that problem after it trips me up.

6 thoughts on “Raspberry Pi vs. Avahi

  1. You did set different host names on all the Raspberry Pis, right?

    Avahi weirdnesses did accidentally cause me to change the host name, password and install Fortran on the demonstrator’s Pi at a meetup last week, instead of on the Zero I had attached to my laptop as a USB gadget. Machines seemed to randomly swap the name raspberrypi.local on the network. Anyway, a machine without Fortran isn’t a machine worth owning, so I did him a favour.

    1. Pummeling the daemon with a quick sequence of “same name, different MAC address” boxen produces peculiar results; setting up a trio of Pi 3 players went poorly until I caught on.

      I now (try to) create the card image and edit the hosts and hostname before booting the Pi, which tends to reduce the carnage out there on the bitstream. Generally, I remember to do that…

  2. I’m trying to think if there is any legitimate reason for one IP address to resolve to 2 or more mac addresses. All I can think of is link aggregation, but that’s not relevant to the PI.

    There is a reason for a DNS name to resolve to more than one IP address – load balancing. And again, that’s not really relevant here, unless you’re listening to a lot of internet radio.

    I should read up on Avahi. Sounds… entertaining. :-)

    1. Although I can’t reproduce it at will, some folks apparently expose things with names like streamer1.local to the Internet At Large, with the amusing result that I when I think I’m pinging one of my gadgets that happens to be down at the time, Avahi (etc,etc) fires the packets across the planet.

      Hilarity ensues…

Comments are closed.