Do reverse service lookup only if address doesn't match node

This commit is contained in:
Wim 2018-05-21 22:27:41 +02:00
parent e8d0474a8e
commit cea77e8825

View file

@ -208,6 +208,8 @@ func (d *DNSServer) handlePtr(resp dns.ResponseWriter, req *dns.Msg) {
}
}
// only look into the services if we didn't find a node
if len(m.Answer) == 0 {
// lookup the service address
serviceAddress := dnsutil.ExtractAddressFromReverse(qName)
sargs := structs.ServiceSpecificRequest{
@ -232,6 +234,7 @@ func (d *DNSServer) handlePtr(resp dns.ResponseWriter, req *dns.Msg) {
}
}
}
}
// nothing found locally, recurse
if len(m.Answer) == 0 {