dns/resolver/axfr_test.go
Miek Gieben 43ebf75fac Fix XFR
The example test performs an axfr, but as ixfr differs slightly
it should also support ixfr
2011-01-01 17:42:13 +01:00

25 lines
431 B
Go

package resolver
import (
"testing"
"fmt"
"dns"
)
func TestAXFR(t *testing.T) {
res := new(Resolver)
ch := NewXfer(res)
res.Servers = []string{"127.0.0.1"}
m := new(dns.Msg)
m.Question = make([]dns.Question, 1)
// ask something
m.Question[0] = dns.Question{"miek.nl", dns.TypeAXFR, dns.ClassINET}
ch <- DnsMsg{m, nil}
for dm := range ch {
fmt.Printf("%v\n",dm.Dns)
}
}