aboutsummaryrefslogtreecommitdiff
path: root/plugin/whoami
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-10-05 06:14:02 -0700
committerGravatar GitHub <noreply@github.com> 2017-10-05 06:14:02 -0700
commitb6086ca8f1c7c7194366b8592fc3d402483aaaea (patch)
treefba3449eeb4d75a1d82dfb73ff54e9213be7813b /plugin/whoami
parent25b2c538c1ea7e4894912a5a82d70c51b18437d0 (diff)
downloadcoredns-b6086ca8f1c7c7194366b8592fc3d402483aaaea.tar.gz
coredns-b6086ca8f1c7c7194366b8592fc3d402483aaaea.tar.zst
coredns-b6086ca8f1c7c7194366b8592fc3d402483aaaea.zip
plugin/whoami (#1132)
Make it work with root zone in the query.
Diffstat (limited to 'plugin/whoami')
-rw-r--r--plugin/whoami/whoami.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugin/whoami/whoami.go b/plugin/whoami/whoami.go
index 9d22c43a8..0a14bd61f 100644
--- a/plugin/whoami/whoami.go
+++ b/plugin/whoami/whoami.go
@@ -41,6 +41,9 @@ func (wh Whoami) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
srv := new(dns.SRV)
srv.Hdr = dns.RR_Header{Name: "_" + state.Proto() + "." + state.QName(), Rrtype: dns.TypeSRV, Class: state.QClass()}
+ if state.QName() == "." {
+ srv.Hdr.Name = "_" + state.Proto() + state.QName()
+ }
port, _ := strconv.Atoi(state.Port())
srv.Port = uint16(port)
srv.Target = "."