mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 03:32:33 +08:00
Fix: expand UDPSize to avoid resolving error (#139)
This commit is contained in:
parent
acf55a7f64
commit
63446da5fa
|
@ -234,6 +234,7 @@ func transform(servers []NameServer) []*nameserver {
|
|||
TLSConfig: &tls.Config{
|
||||
ClientSessionCache: globalSessionCache,
|
||||
},
|
||||
UDPSize: 4096,
|
||||
},
|
||||
Address: s.Addr,
|
||||
})
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user