1

I often find myself doing:

dig www.example.com @$(dig NS example.com +short | head -n 1)

It's a bit like doing a dig +trace www.example.com but starting from the NS of example.com instead of starting from a root, so it's faster and less verbose, which I like.

I was unable to find a dig option (or another tool? a simplier way?) to do so, which I find strange, did I missed one?

Mandark
  • 251
  • 1
  • 2
  • 8
  • 1
    The problem is that there are (typically) more than one authoritative nameserver for a given domain, hence the question: which one to use? No, "the first one" does not apply, since the DNS deals with sets and not lists, so the results of "$domain NS" will be in "random" order, or changing each time. It is true that dig in its outputs shows which nameserver replied, but still doing things that way can be confusing and is non reproductible. Hence I believe the need to be explicit if needed with the `@` option. Maybe other tools (`drill`, `delve`) do it differently? – Patrick Mevzek Mar 06 '19 at 21:21

0 Answers0