How grishy/go-avahi-cname works
Project type and purpose
• go-avahi-cname is a small Go-based command-line tool (also packaged as a container) that communicates with the local Avahi daemon over DBus to publish or reply to mDNS CNAME records on the LAN.
• It has two modes:
• Subdomain reply mode (“subdomain”): listens for any *.hostname.local queries and issues CNAME replies via Avahi.
• Interval publishing mode (“cname”): periodically sends out specified CNAME records for the host.
File structure
• Top-level:
• main.go – entry point
• cmd/ – two subcommands: cname.go, subdomain.go
• avahi/publisher.go – the DBus client and publishing logic
• Dockerfile, .devcontainer/ – container and dev environment setup
• go.mod/sum, CI & release workflows
• Patterns:
• CLI-driven single binary
• Separation between command parsing (cmd/) and Avahi/DBus interaction (avahi/)
• Optional container runtime (Dockerfile)
README for additional insights
• Describes data flows: CLI → DBus → Avahi daemon → mDNS network
• Deployment options: standalone binary under systemd or container with host network and DBus socket mount