Page tree


The dig command performs a DNS lookup on a specified server and displays the results. You can also use the inverse command to perform a reverse DNS lookup. This command displays IDN data in punycode, if any, for the specified server. If you specify IP address of the Microsoft server in this command, the IDN data is displayed in \xyz format.


dig [@server_address] <hostname> [type] [opt...]
dig [@
server_address] <ip-address> inverse

server_addressThe IP address of the host on which you want to perform a DNS lookup.
hostnameThe name of the host on which you want to perform a DNS lookup.
ip-addressThe IP address of the host on which you want to perform a DNS lookup.
typeYou can enter any of the following for the object type (case sensitive): a, a6, aaaa, afsdb, any, apl, axfr, cert, cname, dhcid, div, dname, dnskey, ds, gpos, hinfo, hip, ipseckey, isdn, ixfr, key, keydata, kx, loc, maila, mailb, mb, md, mf, mg, minfo, mr, mx, naptr, none, ns, nsap, nsap_ptr, nsec, nsec3, nsec3param, null, nxt, opt, ptr, px, rp, rrsig, rt, sig, soa, spf, srv, sshfp, tkey, tsig, txt, unspec, wks, and x25. The default is a.

You can enter one or more of the following options:

  • -x (specifies the in-addr lookup)
  • -b address (specifies the binding to the source address)
  • -y name:key (specifies the named base64 tsig key)
  • +vc (enables the TCP mode)
  • +norecurse (disables the recursive mode)
  • +short (disables everything except the short forms of answers)
  • +nssearch (searches all the authoritative nameservers)
  • +trace (traces all the delegations from the root)
  • +cdflag (requests the server not to perform a DNSSEC validation)
  • +dnssec (requests the server to send DNSSEC records)
  • +multiline (displays records in multiple lines)


Perform a DNS lookup

Infoblox > dig @ a
: <<>> DiG 9.6.1-p3 <<>> @ -x a
: <1 server found>
:: global options: +cmd
:: Got answer:
:: >>HEADER<< opcode: QUERY, status: NOERROR, id: 45283
:: flags: qr aa rd ra: QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
:                       IN             A
:: ANSWER SECTION:        3600          IN            CNAME                 600           IN             A        
:: Query time: 2 msec
:: SERVER:<>
:: WHEN: Fri Feb 26 14:06:00 2010
:: MSG SIZE rcvd: 64

Perform a reverse DNS lookup

Infoblox > dig @ inverse
: <<>> DiG 9.6.1-p3 <<>> @ inverse
: <1 server found>
:: global options: +cmd
:: Got answer:
:: >>HEADER<< opcode: QUERY status: NXDOMAIN, id: 37916
:: flags: qr rd ra: QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
:inverse.                        IN          A
. 10800                          IN          SOA 2010022601 1800 900 604800 86400

:: Query time: 132 msec
:: SERVER:<>
:: WHEN: Thu Feb 25 11:20:09 2010
:: MSG SIZE rcvd: 100

This page has no comments.