Add passthrough feature, tests are welcome

This commit is contained in:
Star Brilliant
2018-11-07 17:10:39 +08:00
parent 017a18f20c
commit afa0d563d0
9 changed files with 123 additions and 50 deletions

View File

@@ -245,7 +245,7 @@ func (s *Server) doDNSQuery(req *DNSRequest) (resp *DNSRequest, err error) {
} else {
req.response, _, err = s.tcpClient.Exchange(req.request, req.currentUpstream)
}
if err == nil {
if err == nil || err == dns.ErrTruncated {
return req, nil
}
log.Printf("DNS error from upstream %s: %s\n", req.currentUpstream, err.Error())