Documentation ¶
Overview ¶
Package dns provides mdns dns utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SDService ¶
type SDService struct {
MDNSService *zone.MDNSService
}
SDService is a service that complies with the DNS-SD (RFC 6762) and MDNS (RFC 6762) specs for local, multicast-DNS-based discovery.
SDService implements the Zone interface and wraps an MDNSService instance. To deploy an mDNS service that is compliant with DNS-SD, it's recommended to register only the wrapped instance with the server.
Example usage:
service := &mdns.SDService{ MDNSService: &mdns.MDNSService{ Instance: "My Foobar Service", Service: "_foobar._tcp", Port: 8000, } } server, err := mdns.NewServer(&mdns.Config{Zone: service}) if err != nil { log.Fatalf("Error creating server: %v", err) } defer server.Shutdown()
func (*SDService) Records ¶
Records returns DNS records in response to a DNS question.
This function returns the DNS response of the underlying MDNSService instance. It also returns a PTR record for a request for " _services._dns-sd._udp.<Domain>", as described in section 9 of RFC 6763 ("Service Type Enumeration"), to allow browsing of the underlying MDNSService instance.