Permalink
Browse files

Include node resolution in SRV response extra section.

  • Loading branch information...
1 parent a2246f8 commit 7fc32b18fbab53ed0e76389a38834b0a251a786b @dustin dustin committed Oct 6, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 dns.go
View
14 dns.go
@@ -57,8 +57,20 @@ func (d dnsService) srvList(w dns.ResponseWriter, r *dns.Msg) {
Port: uint16(port),
Target: n.name + "." + *dnsZone,
}
-
msg.Answer = append(msg.Answer, rr)
+
+ arr := &dns.RR_A{
+ Hdr: dns.RR_Header{
+ Name: n.name + "." + *dnsZone,
+ Rrtype: dns.TypeA,
+ Class: dns.ClassINET,
+ Ttl: 60,
+ },
+ A: net.ParseIP(n.Addr),
+ }
+
+ msg.Extra = append(msg.Extra, arr)
+
if len(msg.Answer) > maxDnsResponses {
break
}

0 comments on commit 7fc32b1

Please sign in to comment.