Name

dig

Synopsis

    dig [@server] [options] [name] [type] [class] [query-options]
    dig @
                     server name type
                     dig-h

The dig command queries DNS servers; it is more flexible than the deprecated nslookup command. If you use it without any options or arguments, it searches for the root server. This entry documents the GNU/Linux and Mac OS X version of dig; the Solaris version is slightly different and resides in /usr/sbin. The standard arguments are:

server

The server to query. If no server is supplied, dig checks the name servers listed in /etc/resolv.conf. The address may be an IPv4 dotted address or an IPv6 colon-delimited address. It may also be a hostname, which dig will resolve (through the name servers in /etc/resolv.conf).

name

The domain name to look up.

type

The type of query to perform, such as A, ANY, MX, SIG, and so on. The default is A, but you may use any valid BIND9 query type.

Options

-b address

Set the source IP address for the query.

-c class

Set the class of query. The default value is IN (Internet), but you can choose HS for Hesiod or CH for CHAOSNET.

-f filename

Operate in batch mode, performing the queries in the file you specify.

-h

Print a command-line option summary and exit.

-k filename

Specify a TSIG key file; used for signed transactions. You can also use the -y key, although this is less secure.

-p portnumber

Choose the port number for the query. The default value is the standard DNS port, 53.

-t type

Set the type of query, as with the query argument. The default ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.