Use the fallback for reverse lookups too
I considered a couple of different factorings, that is * Implementing the fallback as a Lookup * Having a server struct that held the resolv.conf and methods for handling queries but ultimately, this is simple and works.
This commit is contained in:
1 parent
fd90212db4
commit
db9bae4162
2 files changed
+14
-5
No files matched your search
@@ -78,5 +78,14 @@ func TestDNSServer(t *testing.T) {
|
||||
t.Fatal("Number of answers > 0")
|
||||
}
|
||||
|
||||
// Not testing MDNS functionality of server here (yet)
|
||||
m.SetQuestion("8.8.8.8.in-addr.arpa.", dns.TypePTR)
|
||||
r, _, err = c.Exchange(m, dnsAddr)
|
||||
wt.AssertNoErr(t, err)
|
||||
wt.AssertStatus(t, r.Rcode, dns.RcodeSuccess, "DNS success response code")
|
||||
if !(len(r.Answer) > 0) {
|
||||
t.Fatal("Number of answers > 0")
|
||||
}
|
||||
|
||||
// Not testing MDNS functionality of server here (yet), since it
|
||||
// needs two servers, each listening on its own address
|
||||
}
|
||||
Reference in new issue
Block a user