dns

package
v0.0.0-...-0a8498d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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

func (s *SDService) Records(q dns.Question) []dns.RR

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL