Commit b6086ca8 authored by Miek Gieben's avatar Miek Gieben Committed by GitHub

plugin/whoami (#1132)

Make it work with root zone in the query.
parent 25b2c538
...@@ -41,6 +41,9 @@ func (wh Whoami) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) ...@@ -41,6 +41,9 @@ func (wh Whoami) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
srv := new(dns.SRV) srv := new(dns.SRV)
srv.Hdr = dns.RR_Header{Name: "_" + state.Proto() + "." + state.QName(), Rrtype: dns.TypeSRV, Class: state.QClass()} 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()) port, _ := strconv.Atoi(state.Port())
srv.Port = uint16(port) srv.Port = uint16(port)
srv.Target = "." srv.Target = "."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment