From b6086ca8f1c7c7194366b8592fc3d402483aaaea Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 5 Oct 2017 06:14:02 -0700 Subject: [PATCH] plugin/whoami (#1132) Make it work with root zone in the query. --- plugin/whoami/whoami.go | 3 +++ 1 file changed, 3 insertions(+) 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 = "."