DIG useful commands

Traces starting from root nameservers. Useful for getting the current nameservers set on a domain;

dig connexeon.com +trace
; <<>> DiG 9.3.3rc2 <<>> @85.158.106.50 connexeon.be +trace
; (1 server found)
;; global options:  printcmd
.                       517276  IN      NS      f.root-servers.net.
.                       517276  IN      NS      g.root-servers.net.
.                       517276  IN      NS      i.root-servers.net.
.                       517276  IN      NS      m.root-servers.net.
.                       517276  IN      NS      h.root-servers.net.
.                       517276  IN      NS      b.root-servers.net.
.                       517276  IN      NS      l.root-servers.net.
.                       517276  IN      NS      d.root-servers.net.
.                       517276  IN      NS      e.root-servers.net.
.                       517276  IN      NS      j.root-servers.net.
.                       517276  IN      NS      c.root-servers.net.
.                       517276  IN      NS      k.root-servers.net.
.                       517276  IN      NS      a.root-servers.net.
;; Received 449 bytes from 85.158.106.50#53(85.158.106.50) in 3 ms

be.                     172800  IN      NS      LONDON.NS.DNS.be.
be.                     172800  IN      NS      PRAGUE.NS.DNS.be.
be.                     172800  IN      NS      X.DNS.be.
be.                     172800  IN      NS      MILANO.NS.DNS.be.
be.                     172800  IN      NS      AMSTERDAM.NS.DNS.be.
be.                     172800  IN      NS      A.NS.DNS.be.
be.                     172800  IN      NS      C.NS.DNS.be.
be.                     172800  IN      NS      B.NS.DNS.be.
be.                     172800  IN      NS      BRUSSELS.NS.DNS.be.
;; Received 383 bytes from 192.5.5.241#53(f.root-servers.net) in 8 ms

connexeon.be.           86400   IN      NS      nl1.ns.connexeon.nl.
connexeon.be.           86400   IN      NS      be1.ns.connexeon.net.
connexeon.be.           86400   IN      NS      be2.ns.connexeon.net.
;; Received 115 bytes from 195.66.241.90#53(LONDON.NS.DNS.be) in 10 ms

connexeon.be.           3600    IN      A       85.158.106.22
;; Received 46 bytes from 94.103.146.163#53(nl1.ns.connexeon.nl) in 7 ms

Gets the SOA records of current nameservers (according to DNS). Useful to see if zones are in sync.

dig connexeon.be +nssearch

or

dig connexeon.be +nssearch | cut -d' ' -f4,11
SOA be1.ns.connexeon.net. noc.connexeon.net. 2008112903 3600 600 1814400 3600 from server be1.ns.connexeon.net in 5 ms.
SOA be1.ns.connexeon.net. noc.connexeon.net. 2008112903 3600 600 1814400 3600 from server be2.ns.connexeon.net in 2 ms.
SOA be1.ns.connexeon.net. noc.connexeon.net. 2008112903 3600 600 1814400 3600 from server nl1.ns.connexeon.nl in 9 ms.