Prints information received from Domain Name System (DNS) servers.


Display A (default) record from DNS for hostname(s)

$ adig []

Display extra [d]ebugging output
$ adig -d []

Connect to a specific DNS [s]erver
$ adig -s [] []

Use a specific TCP port to connect to a DNS server
$ adig -T [port] []

Use a specific UDP port to connect to a DNS server
$ adig -U [port] []


adig [OPTION]... NAME...


Send queries to DNS servers about NAME and print received information, where NAME is a valid DNS name (e.g.,

This utility comes with the c-ares asynchronous resolver library.


-c class

Set the query class. Possible values for class are ANY, CHAOS, HS and IN (default).


Print some extra debugging output.

-f flag

Add a behavior control flag. Possible values for flag are igntc - ignore to query in TCP to get truncated UDP answer, noaliases - don't honor the HOSTALIASES environment variable, norecurse - don't query upstream servers recursively, primary - use the first server, stayopen - don't close the communication sockets, and usevc - always use TCP.

-h, -?

Display this help and exit.

-s server

Connect to specified DNS server, instead of the system's default one(s). Servers are tried in round-robin, if the previous one failed.

-t type

Query records of specified type. Possible values for type are A (default), AAAA, AFSDB, ANY, AXFR, CNAME, GPOS, HINFO, ISDN, KEY, LOC, MAILA, MAILB, MB, MD, MF, MG, MINFO, MR, MX, NAPTR, NS, NSAP, NSAP_PTR, NULL, PTR, PX, RP, RT, SIG, SOA, SRV, TXT, URI, WKS and X25.

-T port

Connect to the specified TCP port of DNS server.

-U port

Connect to the specified UDP port of DNS server.


For an IPv4 -t PTR a.b.c.d lookup, query for This more often gives correct names in the ANSWER.
For an IPv6 -t PTR addr lookup, query for a.b.c....z.IP6.ARPA.


As for -x and an IPv6 address, compact a.b.c....z.IP6.ARPA. into a RFC-2673 bit-string. This compacted bit-string form is not supported by many DNS-servers.


Report bugs to the c-ares mailing list:


This utility is based on code/ideas contained in sofware written by Greg Hudson (ares) carrying the following notice:
Copyright 1998 by the Massachusetts Institute of Technology.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
No further copyright claims are being made by the author(s) of this utility.


acountry(1), ahost(1).

Copied to clipboard