diff --git a/doh-client/doh-client.conf b/doh-client/doh-client.conf index 413b490..7d67ca7 100644 --- a/doh-client/doh-client.conf +++ b/doh-client/doh-client.conf @@ -47,7 +47,7 @@ bootstrap = [ ] # Timeout for upstream request -timeout = 10 +timeout = 30 # Disable HTTP Cookies # diff --git a/doh-client/ietf.go b/doh-client/ietf.go index bc4e625..5615737 100644 --- a/doh-client/ietf.go +++ b/doh-client/ietf.go @@ -134,9 +134,8 @@ func (c *Client) generateRequestIETF(w dns.ResponseWriter, r *dns.Msg, isTCP boo if len(requestURL) < 2048 { req, err = http.NewRequest("GET", requestURL, nil) if err != nil { + // Do not respond, silently fail to prevent caching of SERVFAIL log.Println(err) - reply.Rcode = dns.RcodeServerFailure - w.WriteMsg(reply) return &DNSRequest{ err: err, } @@ -144,9 +143,8 @@ func (c *Client) generateRequestIETF(w dns.ResponseWriter, r *dns.Msg, isTCP boo } else { req, err = http.NewRequest("POST", upstream, bytes.NewReader(requestBinary)) if err != nil { + // Do not respond, silently fail to prevent caching of SERVFAIL log.Println(err) - reply.Rcode = dns.RcodeServerFailure - w.WriteMsg(reply) return &DNSRequest{ err: err, } diff --git a/doh-client/version.go b/doh-client/version.go index 1a90665..9edb98b 100644 --- a/doh-client/version.go +++ b/doh-client/version.go @@ -23,5 +23,7 @@ package main -const VERSION = "1.3.3" -const USER_AGENT = "DNS-over-HTTPS/" + VERSION + " (+https://github.com/m13253/dns-over-https)" +const ( + VERSION = "1.3.3" + USER_AGENT = "DNS-over-HTTPS/" + VERSION + " (+https://github.com/m13253/dns-over-https)" +) diff --git a/doh-server/version.go b/doh-server/version.go index 1a90665..9edb98b 100644 --- a/doh-server/version.go +++ b/doh-server/version.go @@ -23,5 +23,7 @@ package main -const VERSION = "1.3.3" -const USER_AGENT = "DNS-over-HTTPS/" + VERSION + " (+https://github.com/m13253/dns-over-https)" +const ( + VERSION = "1.3.3" + USER_AGENT = "DNS-over-HTTPS/" + VERSION + " (+https://github.com/m13253/dns-over-https)" +)