Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Handle the case of no IP address (typically because of -6)

  • Loading branch information...
commit 6e044dcb120289147af93f4e39312a3b90fbf0c4 1 parent 01247e4
Stephane Bortzmeyer authored

Showing 1 changed file with 13 additions and 3 deletions. Show diff stats Hide diff stats

  1. +13 3 check-soa.go
16 check-soa.go
@@ -188,7 +188,7 @@ func soaQuery(mychan chan SOAreply, zone string, name string, server string) {
188 188 mychan <- result
189 189 }
190 190
191   -func masterTask(zone string, nameserverRecords []dns.RR) (uint, bool, Results) {
  191 +func masterTask(zone string, nameserverRecords []dns.RR) (uint, uint, bool, Results) {
192 192 var (
193 193 numRequests uint
194 194 )
@@ -296,7 +296,7 @@ func masterTask(zone string, nameserverRecords []dns.RR) (uint, bool, Results) {
296 296 results[name] = nameservers[name]
297 297 }
298 298 }
299   - return numNS, success, results
  299 + return numNS, numAddrNS, success, results
300 300 }
301 301
302 302 func main() {
@@ -365,11 +365,21 @@ func main() {
365 365 fmt.Printf("No such domain %s\n", zone)
366 366 os.Exit(1)
367 367 }
368   - numNS, success, results := masterTask(zone, nsResult.r.Answer)
  368 + numNS, numNSaddr, success, results := masterTask(zone, nsResult.r.Answer)
369 369 if numNS == 0 {
370 370 fmt.Printf("No NS records for \"%s\". It is probably a domain but not a zone\n", zone)
371 371 os.Exit(1)
372 372 }
  373 + if numNSaddr == 0 {
  374 + fmt.Printf("No IP addresses for name servers of %s\n", zone)
  375 + if *v4only {
  376 + fmt.Printf("May be retry without -4?\n")
  377 + }
  378 + if *v6only {
  379 + fmt.Printf("May be retry without -6?\n")
  380 + }
  381 + os.Exit(1)
  382 + }
373 383 /* TODO: test if all name servers have the same serial ? */
374 384 keys := make([]string, len(results))
375 385 i := 0

0 comments on commit 6e044dc

Please sign in to comment.
Something went wrong with that request. Please try again.