brutella / dnssd

This library implements Multicast DNS (mDNS) and DNS-Based Service Discovery (DNS-SD) for Zero Configuration Networking in Go.
MIT License
207 stars 33 forks source link

by default listens on port 5353 #23

Closed ripienaar closed 2 years ago

ripienaar commented 3 years ago

I am using your hc project in my choria.io project to do some IoT work and really loving it.

Unfortunately though due to this line:

https://github.com/brutella/dnssd/blob/5bf037ffaa398d044f05a31583ecd9aa60b04e1f/responder.go#L46

Even when hc is not enabled a mdns listener is started and active and talking to the network, this is not desired as I tend to run my software on very large server estates - 10s of thousands of nodes - all of them joining mDNS is a bit of a surprise :) I'd like to enable it only when configured to be enabled.

Investigating further I cannot see anywhere where this DefaultResponder is used in hc or dnssd, would it be possible to either remove this line if its unused or turn it into something thats lazy started only when needed?

I can send a PR with your guidance @brutella

thanks

ripienaar commented 3 years ago

I also looked around some other areas - the DefaultResponder isn't used in any of your repos. It was added here https://github.com/brutella/dnssd/commit/36a2d8c541aab14895fc5492d5ad8ec447a67c47 but even there this DefaultResponder was never used. Seems safe to me to just remove it.

I've confirmed that removing it solves my hassles

brutella commented 3 years ago

You are right. I also think it would be better to remove the default responder completely.

ripienaar commented 3 years ago

You are right. I also think it would be better to remove the default responder completely.

cool, there's a PR ready then