mdns

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

mDNS on OS X

Useful commands:

  • syslog shows Apple System Logs (asl)
  • scutil --dns shows current DNS configuration

Snippet of discoveryd logs

$ curl -vvv test.local
$ syslog -k Time ge "Sep 13 12:25:27"
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Intermediate ClientIPC DNSServiceQueryRecord: ID 418 flags=0x15000, interface=0, name=test.local, rrtype=A, rrclass=1 (curl(21264))
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Detailed Sockets UDS FD=42 SendReturnStatus=0 bytecnt=4 errno=0
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Detailed ClientIPC Connection 202 closing error return socket FD=42
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Detailed Sockets UDS FD=42 close
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Detailed Sockets UDS FD=41 Recv bytecnt=53 errno=0
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Detailed Sockets UDS FD=41 Recv bytecnt=1 errno=0
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Intermediate Bonjour set up question for test.local
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Detailed Sockets UDS FD=42 ErrorReturnSocket
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Detailed ClientIPC Request 202-301 Add event 0x0 en0 : test.local A Record 127.0.0.1, class IN, TTL 65
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Detailed Sockets curl(21264) UDS FD=42
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Intermediate ClientIPC DNSServiceQueryRecord: ID 419 flags=0x15000, interface=0, name=test.local, rrtype=AAAA, rrclass=1 (curl(21264))
...
Sep 13 12:25:27 idora discoveryd[20637] <Notice>: Intermediate Bonjour set up question for test.local
Sep 13 12:25:32 idora discoveryd[20637] <Notice>: Detailed Bonjour timeout Q 418 with flag

Documentation

Index

Constants

View Source
const Domain = "local."

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomHandler

type CustomHandler struct {
	// contains filtered or unexported fields
}

func NewCustomHandler

func NewCustomHandler(ipResolver IPResolver, logger Logger) CustomHandler

func (CustomHandler) ServeDNS

func (d CustomHandler) ServeDNS(responseWriter dns.ResponseWriter, msg *dns.Msg)

type Factory

type Factory struct{}

func NewFactory

func NewFactory() Factory

func (Factory) Build

func (f Factory) Build(ipResolver IPResolver, logger Logger) *Server

type IPResolver

type IPResolver interface {
	ResolveIPv4(string) ([]net.IP, bool, error)
	ResolveIPv6(string) ([]net.IP, bool, error)
}

type LocalIfaceMsgFilter

type LocalIfaceMsgFilter struct {
	// contains filtered or unexported fields
}

func NewLocalIfaceMsgFilter

func NewLocalIfaceMsgFilter(logger Logger) *LocalIfaceMsgFilter

func (*LocalIfaceMsgFilter) AcceptMsg

func (f *LocalIfaceMsgFilter) AcceptMsg(msg *dns.Msg, srcAddr net.Addr) bool

func (*LocalIfaceMsgFilter) UpdateIfacesContiniously

func (f *LocalIfaceMsgFilter) UpdateIfacesContiniously()

type Logger

type Logger interface {
	Error(tag, msg string, args ...interface{})
	Info(tag, msg string, args ...interface{})
	Debug(tag, msg string, args ...interface{})
}

type MsgFilter

type MsgFilter interface {
	AcceptMsg(*dns.Msg, net.Addr) bool
}

type RespWriter

type RespWriter struct {
	// contains filtered or unexported fields
}

func (RespWriter) Close

func (w RespWriter) Close() error

func (RespWriter) Hijack

func (w RespWriter) Hijack()

func (RespWriter) LocalAddr

func (w RespWriter) LocalAddr() net.Addr

func (RespWriter) RemoteAddr

func (w RespWriter) RemoteAddr() net.Addr

func (RespWriter) TsigStatus

func (w RespWriter) TsigStatus() error

func (RespWriter) TsigTimersOnly

func (w RespWriter) TsigTimersOnly(bool)

func (RespWriter) Write

func (w RespWriter) Write([]byte) (int, error)

func (RespWriter) WriteMsg

func (w RespWriter) WriteMsg(msg *dns.Msg) error

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(handler dns.Handler, filter MsgFilter, logger Logger) *Server

func (*Server) Serve

func (s *Server) Serve(startedCh chan struct{}) error

func (*Server) Shutdown

func (s *Server) Shutdown() error

Jump to

Keyboard shortcuts

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