Use exchange again

This commit is contained in:
Miek Gieben 2012-05-07 15:52:50 +02:00
parent 3989e8df9c
commit f0b75bd985
5 changed files with 6 additions and 6 deletions

View File

@ -27,12 +27,12 @@ func main() {
}
for _, a := range addr {
m.Question[0] = dns.Question{"version.bind.", dns.TypeTXT, dns.ClassCHAOS}
in, rtt, _, _ := c.Exchange(m, a)
in, rtt, _, _ := c.ExchangeFull(m, a)
if in != nil && len(in.Answer) > 0 {
fmt.Printf("(time %.3d µs) %v\n", rtt/1e3, in.Answer[0])
}
m.Question[0] = dns.Question{"hostname.bind.", dns.TypeTXT, dns.ClassCHAOS}
in, rtt, _, _ = c.Exchange(m, a)
in, rtt, _, _ = c.ExchangeFull(m, a)
if in != nil && len(in.Answer) > 0 {
fmt.Printf("(time %.3d µs) %v\n", rtt/1e3, in.Answer[0])
}

View File

@ -13,7 +13,7 @@ import (
// returns a fingerprint.
func probe(c *dns.Client, addr string, f *fingerprint) *fingerprint {
m := f.msg()
r, _, _, err := c.Exchange(m, addr)
r, err := c.Exchange(m, addr)
if err != nil {
return errorToFingerprint(err)
}

View File

@ -21,7 +21,7 @@ func main() {
m.SetEdns0(2048, true)
c := dns.NewClient()
r, _, _, _ := c.Exchange(m, conf.Servers[0] + ":" + conf.Port)
r, _ := c.Exchange(m, conf.Servers[0] + ":" + conf.Port)
if r == nil {
fmt.Printf("*** no answer received for %s\n", os.Args[1])
os.Exit(1)

View File

@ -23,7 +23,7 @@ func main() {
m.MsgHdr.RecursionDesired = true
// Simple sync query, nothing fancy
r, _, _, err := c.Exchange(m, config.Servers[0]+":"+config.Port)
r, err := c.Exchange(m, config.Servers[0]+":"+config.Port)
if err != nil {
fmt.Printf("%s\n", err.Error())
os.Exit(1)

View File

@ -341,7 +341,7 @@ func getKey(name string, keytag uint16, server string, tcp bool) *dns.RR_DNSKEY
m := new(dns.Msg)
m.SetQuestion(name, dns.TypeDNSKEY)
m.SetEdns0(4096, true)
r, _, _, err := c.Exchange(m, server)
r, err := c.Exchange(m, server)
if err != nil {
return nil
}