Fix: expand UDPSize to avoid resolving error (#139)

This commit is contained in:
Comzyh 2019-03-17 14:08:15 +08:00 committed by Dreamacro
parent acf55a7f64
commit 63446da5fa
2 changed files with 8 additions and 0 deletions

View File

@ -234,6 +234,7 @@ func transform(servers []NameServer) []*nameserver {
TLSConfig: &tls.Config{
ClientSessionCache: globalSessionCache,
},
UDPSize: 4096,
},
Address: s.Addr,
})

View File

@ -1,8 +1,10 @@
package dns
import (
"fmt"
"net"
"github.com/Dreamacro/clash/log"
D "github.com/miekg/dns"
)
@ -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
}