Skip to content

Commit

Permalink
Fix: expand UDPSize to avoid resolving error (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
comzyh authored and Dreamacro committed Mar 17, 2019
1 parent acf55a7 commit 63446da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions dns/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ func transform(servers []NameServer) []*nameserver {
TLSConfig: &tls.Config{
ClientSessionCache: globalSessionCache,
},
UDPSize: 4096,
},
Address: s.Addr,
})
Expand Down
7 changes: 7 additions & 0 deletions dns/server.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package dns

import (
"fmt"
"net"

"github.com/Dreamacro/clash/log"
D "github.com/miekg/dns"
)

Expand All @@ -20,6 +22,11 @@ func (s *Server) ServeDNS(w D.ResponseWriter, r *D.Msg) {
msg, err := s.r.Exchange(r)

if err != nil {
if len(r.Question) > 0 {
q := r.Question[0]
qString := fmt.Sprintf("%s %s %s", q.Name, D.Class(q.Qclass).String(), D.Type(q.Qtype).String())
log.Debugln("[DNS Server] Exchange %s failed: %v", qString, err)
}
D.HandleFailed(w, r)
return
}
Expand Down

0 comments on commit 63446da

Please sign in to comment.