Skip to content

Lightweight mDNS/DNS-SD library for Go - Service discovery for IoT, microservices, and local networks. Zero dependencies, RFC 6762 compliant.

License

Notifications You must be signed in to change notification settings

joshuafuller/beacon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Beacon - High-Performance mDNS Library for Go

Beacon mDNS

Go Reference Go Report Card License: MIT Ask DeepWiki RFC 6762 P0 RFC 6762 Overall RFC 6763 P0 RFC 6763 Overall

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.


Features

  • 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 →


Quick Start

Installation

go get github.com/joshuafuller/beacon@latest

Announce a Service

import "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 network

Discover Services

import "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)
}

More examples →

Coexistence with System Services

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)

Test it yourself →


Why Beacon?

Built with Engineering Rigor

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

Measurable Results

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

Documentation

📚 Complete Documentation Hub →

👤 For Users

New to Beacon? Start here: Getting Started Guide →

🛠️ For Contributors

🔬 For Researchers/Architects


What's Implemented

mDNS Responder (Service Announcement)

✅ 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

mDNS Querier (Service Discovery)

✅ RFC 6762 §5 Query transmission ✅ Context-aware, cancellable operations ✅ Thread-safe concurrent queries

Platform Support

Linux - Full support ⚠️ macOS/Windows - Code-complete, pending integration tests


Roadmap

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 →


Requirements

  • Go 1.21 or later
  • Standard library only (zero external dependencies)

Contributing

Contributions welcome! We value code, documentation, bug reports, and feature requests.

Read the Contributing Guide →

Quick checklist before submitting a PR:

  • Tests written first (TDD)
  • All tests pass with -race
  • Code coverage ≥80%
  • make semgrep-check passes
  • Documentation updated

See CONTRIBUTING.md for detailed guidelines.


License

MIT License - Copyright (c) 2025 Joshua Fuller


Acknowledgments


Community & Support

About

Lightweight mDNS/DNS-SD library for Go - Service discovery for IoT, microservices, and local networks. Zero dependencies, RFC 6762 compliant.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •