Beacon is a lightweight, high-performance mDNS (Multicast DNS) library for Go, implementing RFC 6762 for service discovery on local networks.
Perfect for: IoT devices, microservices, local network service discovery, replacing unmaintained alternatives.
- 10,000x faster - 4.8μs response latency vs ~50ms in alternatives
- 100% RFC compliance (MUST requirements) - 97.9% RFC 6762, 96.9% RFC 6763 overall
- Zero external dependencies - Standard library only
- Production-tested - 68.6% test coverage, 109,471 fuzz executions, 0 data races
- Automatic conflict resolution - RFC 6762 §8.2 compliant
- SO_REUSEPORT - Coexists with Avahi/Bonjour system services
Note: Beacon achieves 100% compliance with all mandatory (MUST) requirements for both RFC 6762 (Multicast DNS) and RFC 6763 (DNS-Based Service Discovery). The overall percentages (97.9%/96.9%) include optional (SHOULD/MAY) features. See RFC Compliance Certificate for details.
See detailed comparison with hashicorp/mdns →
go get github.com/joshuafuller/beacon@latestimport "github.com/joshuafuller/beacon/responder"
r, _ := responder.New(ctx)
defer r.Close()
svc := &responder.Service{
Instance: "My Web Server",
Service: "_http._tcp",
Domain: "local",
Port: 8080,
TXT: []string{"path=/"},
}
r.Register(ctx, svc) // Service is now announced on the networkimport "github.com/joshuafuller/beacon/querier"
q, _ := querier.New()
defer q.Close()
results, _ := q.Query(ctx, "_http._tcp.local", querier.QueryTypePTR)
for _, rr := range results {
fmt.Printf("Found: %s\n", rr.Name)
}Beacon uses SO_REUSEPORT to peacefully coexist with system mDNS daemons:
# Both Beacon and Avahi/Bonjour can run simultaneously on port 5353
$ sudo ss -ulnp 'sport = :5353'
UNCONN 0.0.0.0:5353 users:(("your-app",pid=...))
UNCONN 0.0.0.0:5353 users:(("avahi-daemon",pid=...))Tested with:
- ✅ Linux: Avahi
- ✅ macOS: Bonjour (code-complete)
- ✅ Windows: mDNS Service (code-complete)
Beacon is built on proven engineering principles:
- RFC Compliance First - Every feature validated against RFC 6762/6763
- Specification-Driven - No code without a spec (Spec Kit framework)
- Test-Driven Development - Tests written first (RED → GREEN → REFACTOR)
- Automated Quality - 25 Semgrep rules enforce compliance
- Constitutional Governance - Development principles enshrined
| Metric | hashicorp/mdns | Beacon | Improvement |
|---|---|---|---|
| Response Latency | ~50ms | 4.8μs | 10,000x faster |
| RFC Compliance (P0) | ~7% | 100% | 14x better |
| RFC Compliance (Overall) | ~7% | 97.9% | 14x better |
| Fuzz Testing | 0 tests | 109,471 execs | ∞ better |
| Test Coverage | ~10 tests | 247 tests | 25x better |
| Data Races | Known | 0 (verified) | Production ready |
📚 Complete Documentation Hub →
New to Beacon? Start here: Getting Started Guide →
- Getting Started - Installation and first steps (15 min)
- Architecture Overview - How Beacon works (10 min)
- Troubleshooting Guide - Common issues and solutions
- API Reference - Complete API documentation
- Examples - Working code samples
- Contributing Guide - How to contribute
- Code of Conduct - Community standards
- Security Policy - Reporting vulnerabilities
- RFC Compliance Certificate - 100% P0, 97.9% overall RFC 6762
- hashicorp/mdns Comparison - Detailed performance comparison
- Performance Analysis - Benchmarks (Grade A+)
- Security Audit - Security posture (STRONG)
- Architecture Decision Records - Why we made key decisions
✅ RFC 6762 §8.1-8.3 Probing, Conflict Resolution, Announcing ✅ RFC 6762 §6.2 Rate Limiting (1 response/sec per record) ✅ RFC 6762 §7.1 Known-Answer Suppression (TTL ≥50%) ✅ Multi-service support per responder
✅ RFC 6762 §5 Query transmission ✅ Context-aware, cancellable operations ✅ Thread-safe concurrent queries
✅ Linux - Full support
v0.1.0 (Current) - Production Ready v0.2.0 - IPv6 support, Goodbye packets v0.3.0 - Unicast response support v0.4.0 - Service browsing
See RFC Compliance Matrix for detailed status →
- Go 1.21 or later
- Standard library only (zero external dependencies)
Contributions welcome! We value code, documentation, bug reports, and feature requests.
Quick checklist before submitting a PR:
- Tests written first (TDD)
- All tests pass with
-race - Code coverage ≥80%
-
make semgrep-checkpasses - Documentation updated
See CONTRIBUTING.md for detailed guidelines.
MIT License - Copyright (c) 2025 Joshua Fuller
- Inspired by the need for a modern alternative to hashicorp/mdns
- Implements RFC 6762 and RFC 6763
- Built using Spec Kit framework
- Questions? GitHub Discussions
- Bug Reports: GitHub Issues
- Security Issues: See SECURITY.md
- Email: joshuafuller@gmail.com