diff --git a/go.mod b/go.mod
index 4b499bfc809bc6cddb6488d19bb5b8993740ac70..9cce3375db6d589c0e2b482294b04ff4c51ef66b 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.14
 require (
 	git.autistici.org/ai3/go-common v0.0.0-20210118064555-73f00db54723
 	git.autistici.org/ai3/tools/replds v0.0.0-20210117165138-e6368d266143
-	github.com/miekg/dns v1.1.39
+	github.com/miekg/dns v1.1.40
 	github.com/prometheus/client_golang v1.9.0
 	github.com/prometheus/procfs v0.3.0 // indirect
 	golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
diff --git a/go.sum b/go.sum
index af6ca560b8a17227d251308a9827ea3481c27be0..459c1853f781fb79190e3e48e8bc7de4c13fed3d 100644
--- a/go.sum
+++ b/go.sum
@@ -203,6 +203,8 @@ github.com/miekg/dns v1.1.38 h1:MtIY+fmHUVVgv1AXzmKMWcwdCYxTRPG1EDjpqF4RCEw=
 github.com/miekg/dns v1.1.38/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
 github.com/miekg/dns v1.1.39 h1:6dRfDGnHiXOMmTZkwWANy7bBXXlKls5Qu+pn+Ue0TLo=
 github.com/miekg/dns v1.1.39/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
+github.com/miekg/dns v1.1.40 h1:pyyPFfGMnciYUk/mXpKkVmeMQjfXqt3FAJ2hy7tPiLA=
+github.com/miekg/dns v1.1.40/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
 github.com/miscreant/miscreant.go v0.0.0-20200214223636-26d376326b75/go.mod h1:pBbZyGwC5i16IBkjVKoy/sznA8jPD/K9iedwe1ESE6w=
 github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
 github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
diff --git a/vendor/github.com/miekg/dns/README.md b/vendor/github.com/miekg/dns/README.md
index e5a037f03b56c8b813edd59b6141537aa893ade2..3594492b7cd13217b483f0886c8d8cf9902107a0 100644
--- a/vendor/github.com/miekg/dns/README.md
+++ b/vendor/github.com/miekg/dns/README.md
@@ -72,6 +72,7 @@ A not-so-up-to-date-list-that-may-be-actually-current:
 * https://github.com/Luzilla/dnsbl_exporter
 * https://github.com/bodgit/tsig
 * https://github.com/v2fly/v2ray-core (test only)
+* https://kuma.io/
 
 
 Send pull request if you want to be listed here.
diff --git a/vendor/github.com/miekg/dns/server.go b/vendor/github.com/miekg/dns/server.go
index eec02ef9b7a7f837f9b7b3c1e4fa59b08975c3d8..b2a63bda4958ec644b61fc1154e46f94f8dc4323 100644
--- a/vendor/github.com/miekg/dns/server.go
+++ b/vendor/github.com/miekg/dns/server.go
@@ -321,6 +321,7 @@ func (srv *Server) ListenAndServe() error {
 		}
 		u := l.(*net.UDPConn)
 		if e := setUDPSocketOptions(u); e != nil {
+			u.Close()
 			return e
 		}
 		srv.PacketConn = l
diff --git a/vendor/github.com/miekg/dns/version.go b/vendor/github.com/miekg/dns/version.go
index 4c33f0a5f4dab5eb6eb86c57d6ecc316559d0d47..8f7cf768812809735c266db32bc529d1b46e707b 100644
--- a/vendor/github.com/miekg/dns/version.go
+++ b/vendor/github.com/miekg/dns/version.go
@@ -3,7 +3,7 @@ package dns
 import "fmt"
 
 // Version is current version of this library.
-var Version = v{1, 1, 39}
+var Version = v{1, 1, 40}
 
 // v holds the version of this library.
 type v struct {
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 04bf0e15ef7d4794d8ecec0a387eda42e34033b2..23ca0465f1bd9cbe72199575e2d947220702cbc4 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -31,7 +31,7 @@ github.com/golang/protobuf/ptypes/timestamp
 github.com/gorilla/handlers
 # github.com/matttproud/golang_protobuf_extensions v1.0.1
 github.com/matttproud/golang_protobuf_extensions/pbutil
-# github.com/miekg/dns v1.1.39
+# github.com/miekg/dns v1.1.40
 ## explicit
 github.com/miekg/dns
 # github.com/openzipkin/zipkin-go v0.2.5