diff --git a/dns/transport/local/local.go b/dns/transport/local/local.go index e4236275..4e05ff02 100644 --- a/dns/transport/local/local.go +++ b/dns/transport/local/local.go @@ -139,6 +139,9 @@ func (t *Transport) tryOneName(ctx context.Context, config *dnsConfig, fqdn stri } func (t *Transport) exchangeOne(ctx context.Context, server M.Socksaddr, question mDNS.Question, timeout time.Duration, useTCP, ad bool) (*mDNS.Msg, error) { + if server.Port == 0 { + server.Port = 53 + } var networks []string if useTCP { networks = []string{N.NetworkTCP} diff --git a/dns/transport/local/local_fallback.go b/dns/transport/local/local_fallback.go index 0a7cd9f0..cd2d198f 100644 --- a/dns/transport/local/local_fallback.go +++ b/dns/transport/local/local_fallback.go @@ -58,8 +58,12 @@ func (f *FallbackTransport) Start(stage adapter.StartStage) error { return nil } +func (f *FallbackTransport) Close() error { + return nil +} + func (f *FallbackTransport) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.Msg, error) { - if f.fallback { + if !f.fallback { return f.DNSTransport.Exchange(ctx, message) } question := message.Question[0]