Fix examples NewClient() -> new(dns.Client)
This commit is contained in:
parent
7e2d4ac1d4
commit
a550bf6d40
|
@ -15,7 +15,7 @@ func main() {
|
|||
flag.Parse()
|
||||
zone := flag.Arg(flag.NArg() - 1)
|
||||
|
||||
client := dns.NewClient()
|
||||
client := new(dns.Client)
|
||||
client.Net = "tcp"
|
||||
m := new(dns.Msg)
|
||||
if *serial > 0 {
|
||||
|
|
|
@ -18,7 +18,7 @@ func main() {
|
|||
|
||||
m := new(dns.Msg)
|
||||
m.Question = make([]dns.Question, 1)
|
||||
c := dns.NewClient()
|
||||
c := new(dns.Client)
|
||||
|
||||
addr := addresses(conf, c, os.Args[1])
|
||||
if len(addr) == 0 {
|
||||
|
|
|
@ -38,7 +38,7 @@ func main() {
|
|||
}
|
||||
nameserver = string([]byte(nameserver)[1:]) // chop off @
|
||||
nameserver += ":" + strconv.Itoa(*port)
|
||||
c := dns.NewClient()
|
||||
c := new(dns.Client)
|
||||
prints, _ := fingerPrintFromFile("data/q")
|
||||
results := make([]*fingerprint, 0)
|
||||
if *report {
|
||||
|
|
|
@ -20,7 +20,7 @@ func main() {
|
|||
m.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeDNSKEY)
|
||||
m.SetEdns0(2048, true)
|
||||
|
||||
c := dns.NewClient()
|
||||
c := new(dns.Client)
|
||||
r, _ := c.Exchange(m, conf.Servers[0]+":"+conf.Port)
|
||||
if r == nil {
|
||||
fmt.Printf("*** no answer received for %s\n", os.Args[1])
|
||||
|
|
|
@ -16,8 +16,7 @@ func main() {
|
|||
|
||||
// Error checking
|
||||
config, _ := dns.ClientConfigFromFile("/etc/resolv.conf")
|
||||
c := dns.NewClient()
|
||||
|
||||
c := new(dns.Client)
|
||||
m := new(dns.Msg)
|
||||
m.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeMX)
|
||||
m.MsgHdr.RecursionDesired = true
|
||||
|
|
|
@ -137,7 +137,7 @@ Flags:
|
|||
// We use the async query handling, just to show how it is to be used.
|
||||
dns.HandleQuery(".", q)
|
||||
dns.ListenAndQuery(nil)
|
||||
c := dns.NewClient()
|
||||
c := new(dns.Client)
|
||||
if *tcp {
|
||||
c.Net = "tcp"
|
||||
if *four {
|
||||
|
@ -351,7 +351,7 @@ func getRRset(l []dns.RR, name string, t uint16) []dns.RR {
|
|||
// Get the key from the DNS (uses the local resolver) and return them.
|
||||
// If nothing is found we return nil
|
||||
func getKey(name string, keytag uint16, server string, tcp bool) *dns.RR_DNSKEY {
|
||||
c := dns.NewClient()
|
||||
c := new(dns.Client)
|
||||
if tcp {
|
||||
c.Net = "tcp"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue