Skip to content

Commit

Permalink
use the service specific address in SRV response
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinDMC committed Jan 5, 2015
1 parent 051ac8e commit bd65cbb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion command/agent/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,14 @@ func (d *DNSServer) serviceSRVRecords(dc string, nodes structs.CheckServiceNodes
}
resp.Answer = append(resp.Answer, srvRec)

// Determine advertised address
addr := node.Node.Address
if node.Service.Address != "" {
addr = node.Service.Address
}

// Add the extra record
records := d.formatNodeRecord(&node.Node, node.Node.Address, srvRec.Target, dns.TypeANY, ttl)
records := d.formatNodeRecord(&node.Node, addr, srvRec.Target, dns.TypeANY, ttl)
if records != nil {
resp.Extra = append(resp.Extra, records...)
}
Expand Down

0 comments on commit bd65cbb

Please sign in to comment.