Finding your DCC-EX command station's IP with avahi-browse
Your command station changed address after a DHCP lease change. Here's how to find it in about ten seconds using mDNS discovery.
The command station has moved and nothing can reach it. Rather than scanning the whole subnet or squinting at the router’s client list, ask the network directly.
The quick answer
On any Linux machine on the same network:
avahi-browse -art
Look for a WiThrottle service. The resolved entry gives you the hostname, the IP address and the port in one go.
To narrow it to just throttle services:
avahi-browse -rt _withrottle._tcp
The flags: -a all service types, -r resolve to addresses rather than just listing names,
-t terminate once the initial results are in rather than watching indefinitely.
Installing it
# Debian / Ubuntu / Raspberry Pi OS
sudo apt install avahi-utils
# Arch
sudo pacman -S avahi
# Fedora
sudo dnf install avahi-tools
The daemon needs to be running for browsing to work:
sudo systemctl enable --now avahi-daemon
Why this works
mDNS is DNS with no server. A device that wants to be findable multicasts its name and services to the local network; anything listening builds a picture of what is out there. It is the same mechanism that makes printers and media players appear on their own.
DCC-EX firmware with WiThrottle support advertises itself this way, which means it announces its own address whether or not you know what it changed to.
Crucially this asks the device where it is, rather than asking the router what it handed out or scanning every address in the range. It works even when the router’s client list shows a useless generic name.
On other platforms
macOS has the same thing built in under a different name:
dns-sd -B _withrottle._tcp
dns-sd -L "NAME_FROM_ABOVE" _withrottle._tcp
Windows has no equivalent built in. Bonjour, if installed, brings dns-sd. Otherwise use a
network scanner, or run the Linux command from anything else on the network — a Raspberry Pi
is ideal, and if the layout has one already, it is the natural place for this.
When it finds nothing
Nothing at all listed. The daemon probably is not running, or the firewall is blocking
UDP 5353. Check systemctl status avahi-daemon, and allow 5353/udp if the firewall is on.
Other devices listed but not the command station. Either its firmware does not advertise
WiThrottle, or it is not on the network. Try avahi-browse -art unfiltered before concluding
anything — it may be advertising a different service type.
Nothing works and the command station is on a different subnet. mDNS is link-local by design and does not cross subnets. If the command station is on a guest network or a separate VLAN, no amount of browsing from here will find it.
Wireless isolation. Many routers have a setting preventing wireless clients from talking to each other. It blocks multicast along with everything else, and it breaks far more than this.
Finding the address solves today. Tying the command station's MAC address to a fixed IP in the router solves it permanently — see network troubleshooting.
Scripting it
Worth having in a shell profile if you do this more than twice:
alias findloco="avahi-browse -rt _withrottle._tcp | grep -A3 hostname"
Where to go next
- Network troubleshooting for DCC-EX — the permanent fixes
- Rocrail and DCC-EX — updating the address once you have it