Skip to content

About

Lightweight mDNS / DNS-SD (Zeroconf) hostname and services announcer for BusyBox. POSIX shell script with minimal footprint for embedded Linux and containers.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

latest packaged version(s)

Tiny mDNS Announcer

tiny-mdns-ann is a lightweight shell utility to announce device's .local hostname and network services via mDNS.
Hostname can then be resolved by any machine supporting mDNS/Avahi LAN discovery.

tiny-mdns-ann only depends on netcat, as found in busybox, or other standalone implementations.
It merely sends unsolicited UDP announcement packets, and does not answer queries.
It is a best-effort lightweight announcer, and is not intended as a replacement for fully compliant mDNS responder.

Features:

  • hostname LAN IP address resolution
  • optionally advertises http and ssh services
  • IPv4 and IPv6 support
  • OpenRC and Systemd services

Benefits:

  • extremely small footprint
  • runs under POSIX shell
  • compatible with busybox's nc
  • leverages socat if available, for more robust announcements

Setup procedure:

Make script executable and run tiny-mdns-ann on device as follows:

usage: tiny-mdns-ann [OPTIONS]

Announce HOSTNAME.local over mDNS on active interfaces.

Options:
  --help                Show this help.
  --host NAME           Host name to announce in the .local domain.
  --http[=PORT[,PATH]]  Advertise HTTP, default port 80, path /.
  --ssh[=PORT]          Advertise SSH, default port 22.

Environment:
  INTERVAL              Announcement interval in seconds, default 60.
  ADVERTISE_IPV6        Enable IPv6 announcements, default 1.
  DEBUG_LOG             Log each announcement, default 0.

Main execution steps are logged: grep tiny-mdns-ann /var/log/messages.

OpenRC and Systemd services files are provided to run tiny-mdns-ann as a boot service.
A complete Alpine Linux package is also in the works.

Packaging status

Note & limitations:

  • As nc does not allow multicast ttl/hop-limit controls, announcements do not set mDNS-required value of 255, but work just fine in most cases.
  • If socat is available, it is used in place of nc to send announcements with ttl/hop-limit 255.
  • hosts with advanced networking routing setup or firewall may need to adapt settings to let mdns port 5353 free for sending announcements.

Buy Me a Coffee at ko-fi.com

About

Lightweight mDNS / DNS-SD (Zeroconf) hostname and services announcer for BusyBox. POSIX shell script with minimal footprint for embedded Linux and containers.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages