add localTCPAddr := dnssecsocket.ResolveIPv6hostname("librem15.lab.wit.com")

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-09 17:57:51 -07:00
parent 9070d87fba
commit d38dbbdf70
1 changed files with 7 additions and 0 deletions

View File

@ -146,3 +146,10 @@ func Dnstrace(hostname string, qtypestr string) dns.RR {
}
return nil
}
func ResolveIPv6hostname(hostname string) *net.TCPAddr {
dnsRR := Dnstrace(hostname, "AAAA")
aaaa := dns.Field(dnsRR, 1)
localTCPAddr, _ := net.ResolveTCPAddr("tcp", aaaa)
return localTCPAddr
}