This commit is contained in:
Miek Gieben 2012-05-26 10:28:55 +02:00
parent 2a69247960
commit 7e2d4ac1d4
4 changed files with 31 additions and 32 deletions

View File

@ -58,8 +58,8 @@ func addresses(conf *dns.ClientConfig, c *dns.Client, name string) []string {
m4.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeA) m4.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeA)
m6 := new(dns.Msg) m6 := new(dns.Msg)
m6.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeAAAA) m6.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeAAAA)
c.Do(m4, conf.Servers[0] + ":" + conf.Port) c.Do(m4, conf.Servers[0]+":"+conf.Port)
c.Do(m6, conf.Servers[0] + ":" + conf.Port) c.Do(m6, conf.Servers[0]+":"+conf.Port)
var ips []string var ips []string
i := 2 // two outstanding queries i := 2 // two outstanding queries

View File

@ -214,7 +214,6 @@ func toFingerprint(m *dns.Msg) *fingerprint {
f.Query.Qclass = 0 f.Query.Qclass = 0
} }
f.Opcode = h.Opcode f.Opcode = h.Opcode
f.Rcode = h.Rcode f.Rcode = h.Rcode
f.Response = h.Response f.Response = h.Response

View File

@ -76,7 +76,7 @@ func main() {
listen := flag.String("listen", "127.0.0.1:8053", "set the listener address") listen := flag.String("listen", "127.0.0.1:8053", "set the listener address")
server := flag.String("server", "127.0.0.1:53", "remote server address(es), seperate with commas") server := flag.String("server", "127.0.0.1:53", "remote server address(es), seperate with commas")
verbose = flag.Bool("verbose", false, "Print packet as it flows through") verbose = flag.Bool("verbose", false, "Print packet as it flows through")
// cpuprofile := flag.String("cpuprofile", "", "write cpu profile to file") // cpuprofile := flag.String("cpuprofile", "", "write cpu profile to file")
flag.Usage = func() { flag.Usage = func() {
flag.PrintDefaults() flag.PrintDefaults()
} }

View File

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