summaryrefslogtreecommitdiff
path: root/hostname.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-01 11:21:47 -0600
committerJeff Carr <[email protected]>2023-03-01 11:21:47 -0600
commit3ce3a39226bd6c0e738cdf76a55b05be1bad3cc3 (patch)
tree56d06a8768af58395d8be5027d770ca0d674e8a8 /hostname.go
parente517baeb87767d9d8abe276ff38b0d324561c3c3 (diff)
tagging against wit/gui v0.6.1
using Queue() for textbox fixes crashing (?) change TTL to 2 minutes gui debugging checkboxes make a dig test button Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'hostname.go')
-rw-r--r--hostname.go23
1 files changed, 10 insertions, 13 deletions
diff --git a/hostname.go b/hostname.go
index 4725d2c..98c9f49 100644
--- a/hostname.go
+++ b/hostname.go
@@ -25,21 +25,18 @@ func getHostname() {
return
}
log("FQDN hostname is", me.fqdn)
-
- var aaaa []string
- aaaa = getAAAA(me.fqdn)
- log("AAAA =", aaaa)
}
-func getAAAA(s string) []string {
+func dnsAAAA(s string) []string {
+ var aaaa []string
// lookup the IP address from DNS
- dnsRR := dnssecsocket.Dnstrace(s, "AAAA")
- log(args.VerboseDNS, SPEW, dnsRR)
- if (dnsRR == nil) {
- return nil
+ rrset := dnssecsocket.Dnstrace(s, "AAAA")
+ log(args.VerboseDNS, SPEW, rrset)
+ for i, rr := range rrset {
+ log(args.VerboseDNS, "r.Answer =", i, rr)
+ ipaddr := dns.Field(rr, 1)
+ aaaa = append(aaaa, ipaddr)
}
- ipaddr1 := dns.Field(dnsRR, 1)
- ipaddr2 := dns.Field(dnsRR, 2)
- log("ipaddr", ipaddr1, ipaddr2)
- return []string{ipaddr1, ipaddr2}
+ log(args.VerboseDNS, "aaaa =", aaaa)
+ return aaaa
}