Skip to content

Commit

Permalink
Adapt to last Go DNS api
Browse files Browse the repository at this point in the history
  • Loading branch information
miekg committed Nov 30, 2012
1 parent 40d9e76 commit e00288d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions check_dns_soa.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import (
"./nagios"
"bytes"
"errors"
"flag"
"fmt"
"github.com/miekg/check_dns_soa/nagios" // Needed to make it compile...
"github.com/miekg/dns"
"net"
"os"
Expand Down Expand Up @@ -38,7 +38,7 @@ func localQuery(qname string, qtype uint16) (r *dns.Msg, err error) {
localm.Question[0] = dns.Question{qname, qtype, dns.ClassINET}
for serverIndex := range conf.Servers {
server := conf.Servers[serverIndex]
r, err := localc.Exchange(localm, server+":"+conf.Port)
r, _, err := localc.Exchange(localm, net.JoinHostPort(server, conf.Port))
if r == nil {
return r, err
}
Expand All @@ -59,7 +59,7 @@ func testSoa(msg *dns.Msg, server string, tries uint) (soa *dns.Msg, err error)
tests := uint(0)
over := false
for !over {
soa, err = c.Exchange(msg, server)
soa, _, err = c.Exchange(msg, server)
if err != nil {
if e, ok := err.(net.Error); ok && e.Timeout() {
tests++
Expand Down

0 comments on commit e00288d

Please sign in to comment.