plugin/whoami (#1132)

Make it work with root zone in the query.
This commit is contained in:
Miek Gieben 2017-10-05 06:14:02 -07:00 committed by GitHub
parent 25b2c538c1
commit b6086ca8f1

View file

@ -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 = "."