dnsget (1) - Linux Manuals

dnsget: DNS lookup utility

NAME

dnsget - DNS lookup utility

SYNOPSYS

dnsget [-v|-q] [-c class] [-t type] [-o opt,opt,...] name...

DESCRIPTION

dnsget is a simple command-line to perform DNS lookups, similar to host(1) and dig(1). It is useable for both interactive/debugging scenarious and in scripts. The program is implemented using udns(3) library.

By default, dnsget produces a human-readable output, similar to

alias.example.com. CNAME www.example.com.
www.example.com. A 192.168.1.1
www.example.com. MX 10 mx.example.com.
which is just sufficient to see how a given name resolves. Output format is controllable with -v and -q options -- the former increases verbosity level up to printing the whole DNS contents of all packets sent and received, which is suitable for debugging DNS problems, while the latter reduces the level, making output more quiet, up to bare result with no error messages, which is good for scripts.

OPTIONS

The following options are recognized by dnsget:

-v
produce more detailed output. More -v's means more details will be produced. With single -v,dnsget will print contents of all received DNS packets (in a readable format), while with -vv, it will output all outgoing DNS packets too.

-q
the opposite for -v -- produce less detailed output. With single -q,dnsget will only show (decoded) data from final DNS resource records (RR), while -qq also suppresses error messages.

-t type
request record(s) of the given type type. By default, dnsget will ask for IPv4 address (A) record, or for PTR record if the argument in question is an IPv4 or IPv6 address. Recognized types include A, AAAA, MX, TXT, CNAME, PTR, NS, SOA, ANY and others.

-c class
request DNS record(s) of the given class class. By default dnsget uses IN class. Valid classes include IN, CH, HS, ANY.

-a
(compatibility option). Equivalent to setting query type to ANY and increasing verbosity level (-v).

-C
(planned)

-x
(planned)

-o opt,opt,...
(may be specified several times). Set resolver options (in a form option:value) as if they were set in $RES_OPTIONS environment variable, or set query flags:
timeout:sec
Set initial query timeout to sec.
attempts:num
(re)try every query num times before failing.
udpbuf:bytes
set DNS UDP buffer size to bytes bytes. Valid values are from 512 to 65535. If bytes is greather than 512, EDNS0 (RFC 2671) extensions will be used.
port:num
Use given UDP port number num instead of the default port 53 (domain).
aa
set AA (auth only) query bit.
nord
do not set RD (recursion desired) query bit (set by default).
dnssec or do
set DNSSEC OK (DO) query flag (dnsget does not verify DNSSEC signatures, only displays them; this is set in EDNS RR).
cd
set CD (checking disabled) query bit.

-n nameserver
Use the given nameserver(s) (may be specified more than once) instead of the default. Using this option has the same same effect as $NSCACHEIP or $NAMESERVERS environment variables, with the only difference that only IPv4 addresses are recognized for now, and it is possible to specify names (which will be resolved using default settings) instead of IP addresses.

-h
print short help and exit.

RETURN VALUE

When all names where resovled successefully, dnsget exits with zero exit status. If at least one name was not found, dnsget will exit with return code 100. If some other error occured during name resolution, it will exit with code 99. In case of usage or initialization error, dnsget will return 1.

SEE ALSO

host(1) dig(1) resolv.conf(5) udns(3).