SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from RedHat Other bind-chroot-utils-8.1.2-9.i386.rpm

DIG

Section: User Commands (1)
Index
BSD mandoc
BSD 4 

NAME

dig - send domain name query packets to name servers 

SYNOPSIS

dig [@ server]domain[Aq query-type][Aq query-class][+ Aq query-option][-Aq dig-option][%comment] 

DESCRIPTION

Dig(domain information groper) is a flexible command line toolwhich can be used to gather information from the DomainName System servers. Dighas two modes: simple interactive modefor a single query, and batch mode which executes a query foreach in a list of several query lines. All query options areaccessible from the command line.

The usual simple use of digwill take the form:

dig @ server domain query-type query-class

where:

server
may be either a domain name or a dot-notationInternet address. If this optional field is omitted, digwill attempt to use the default name server for your machine.

Note:If a domain name is specified, this will be resolvedusing the domain name system resolver (i.e., BIND). If yoursystem does not support DNS, you may haveto specify adot-notation address. Alternatively, if there is a serverat your disposal somewhere, all that is required is that/etc/resolv.conf be present and indicate where the defaultname servers reside, so that server itself can be resolved. See resolver(5)for information on /etc/resolv.conf WARNING: Changing /etc/resolv.conf will affect both the standard resolver library and (potentially )several programs which use it.As an option, the user may set theenvironment variable LOCALRES to name a file which is tobe used instead of /etc/resolv.conf Po Ns Ev LOCALRES is specific to the digresolver and is not referenced by the standard resolverPc .If the LOCALRES variable is not set or the specified fileis not readable, then /etc/resolv.conf will be used.

domain
is the domain name for which you are requesting information.See the -x option (documented in theSx OTHER OPTIONS subsection of this section) for convenient way to specify inverse addressquery.
query-type
is the type of information (DNS query type) thatyou are requesting. If omitted, the default is ``a ''(T_A = address) The following types are recognized:

a       T_A
network address
any     T_ANY
all/any information about specified domain
mx      T_MX
mail exchanger for the domain
ns      T_NS
name servers
soa     T_SOA
zone of authority record
hinfo   T_HINFO
host information
axfr    T_AXFR
zone transfer (must ask an authoritative server)
txt     T_TXT
arbitrary number of strings

(See RFC 1035 for the complete list.)

query-class
is the network class requested in the query. Ifomitted, the default is ``in ''(C_IN = Internet) The following classes are recognized:

in      C_IN
Internet class domain
any     C_ANY
all/any class information

(See RFC 1035 for the complete list.)

Note:``Any''can be used to specify a class and/or a type of query. Digwill parse the first occurrence of ``any''to mean query-type = T_ANY . To specify query-class = C_ANY you must either specify ``any ''twice, or setquery-class using the -c option (see below).

 

OTHER OPTIONS

% ignored-comment
``% ''is used to included an argument that is simply notparsed. This may be useful if running digin batchmode. Instead of resolving every @server-domain-name in a list of queries, you can avoid the overhead of doingso, and still have the domain name on the command lineas a reference. Example:

dig @128.9.0.32 %venera.isi.edu mx isi.edu

-Aq dig option
``-''is used to specify an option which affects the operation of dig . The following options are currentlyavailable (although not guaranteed to be useful):

-x dot-notation-address
Convenient form to specify inverse address mapping.Instead of ``dig 32.0.9.128.in-addr.arpa , ''one can simply ``dig -x 128.9.0.32''
-f file
File for digbatch mode. The file contains a listof query specifications(dig command lines) which are to be executed successively. Lines beginning with `;' `#' or`\n 'are ignored. Other optionsmay still appear on command line, and will be ineffect for each batch query.
-T time
Time in seconds between start of successivequeries when running in batch mode. Can be usedto keep two or more batch digcommands runningroughly in sync. Default is zero.
-p port
Port number. Query a name server listening to anon-standard port number. Default is 53.
-P Bq ping-string
After query returns, execute a ping(8)command for response time comparison. This ratherunelegantly makes a call to the shell. The lastthree lines of statistics is printed for thecommand:

ping -s server_name 56 3

If the optional ``ping_string ''is present, itreplaces ``ping -s ''in the shell command.

-t query-type
Specify type of query. May specify either aninteger value to be included in the type fieldor use the abbreviated mnemonic as discussedabove (i.e., mx = T_MX
-c query-class
Specify class of query. May specify either aninteger value to be included in the class fieldor use the abbreviated mnemonic as discussedabove (i.e., in = C_IN).
-envsav
This flag specifies that the digenvironment(defaults, print options, etc.), afterall of the arguments are parsed, should be savedto a file to become the default environment.This is useful if you do not like the standard set ofdefaults and do not desire to include alarge number of options each time digis used. The environment consists of resolver statevariable flags, timeout, and retries as well as the flags detailing digoutput (see below).If the shell environment variable LOCALDEF is set to the name of a file, this is where the defaultdigenvironment is saved. If not, the file``DiG.env ''is created in the current working directory.

Note: LOCALDEF is specific to the digresolver,and will not affect operation of the standardresolver library.

Each time digis executed, it looks for ``./DiG.env''or the file specified by the shell environment variableLOCALDEF . If such file exists and is readable, then theenvironment is restored from this file before any arguments are parsed.

-envset
This flag only affects batch query runs. When ``-envset ''is specified on a line in a digbatch file, the digenvironment after the arguments are parsedbecomes the default environment for the duration ofthe batch file, or until the next line which specifies``-envset''
-[no ]stick
This flag only affects batch query runs.It specifies that the digenvironment (as read initiallyor set by ``-envset ''switch) is to be restored before each query (line) in a digbatch file.The default ``-nostick ''means that the digenvironment does not stick, hence options specified on a single linein a digbatch file will remain in effect forsubsequent lines (i.e. they are not restored to the ``sticky ''default).

+ Aq query-option
``+''is used to specify an option to be changed in the query packet or to change digoutput specifics. Many of these are the same parameters accepted by nslookup(8).If an option requires a parameter, the form is as follows:

+ keyword [= value]

Most keywords can be abbreviated. Parsing of the ``+''options is very simplistic --- a value must not beseparated from its keyword by white space. The followingkeywords are currently available:

Keyword Abbrev. Meaning [default]

[no ]debug    (deb)
turn on/off debugging mode Bq Cm deb
[no ]d2          
turn on/off extra debugging mode Bq Cm nod2
[no ]recurse  (rec)
use/don't use recursive lookup Bq Cm rec
retry= file ...      (ret)
set number of retries to # Bq 4
time= file ...       (ti)
set timeout length to # seconds Bq 4
[no ]ko
keep open option (implies vc) Bq Cm noko
[no ]vc
use/don't use virtual circuit Bq Cm novc
[no ]defname  (def)
use/don't use default domain name Bq Cm def
[no ]search   (sea)
use/don't use domain search list Bq Cm sea
domain= NAME  (do)
set default domain name to NAME
[no ]ignore   (i)
ignore/don't ignore trunc. errors Bq Cm noi
[no ]primary  (pr)
use/don't use primary server Bq Cm nopr
[no ]aaonly   (aa)
authoritative query only flag Bq Cm noaa
[no ]cmd
echo parsed arguments Bq Cm cmd
[no ]stats    (st)
print query statistics Bq Cm st
[no ]Header   (H)
print basic header Bq Cm H
[no ]header   (he)
print header flags Bq Cm he
[no ]ttlid    (tt)
print TTLs Bq Cm tt
[no ]cl
print class info Bq Cm nocl
[no ]qr
print outgoing query Bq Cm noqr
[no ]reply    (rep)
print reply Bq Cm rep
[no ]ques     (qu)
print question section Bq Cm qu
[no ]answer   (an)
print answer section Bq Cm an
[no ]author   (au)
print authoritative section Bq Cm au
[no ]addit    (ad)
print additional section Bq Cm ad
pfdef
set to default print flags
pfmin
set to minimal default print flags
pfset= #
set print flags to #(# can be hex/octal/decimal)
pfand= file ...
bitwise and print flags with #
pfor= file ...
bitwise or print flags with #

The retry and time options affect the retransmission strategy used by the resolver library when sending datagram queries. The algorithm is as follows:

for i = 0 to retry - 1    for j = 1 to num_servers        send_query        wait((time * (2**i)) / num_servers)    endend

(Note: digalways uses a value of 1 for ``num_servers . ) ''

 

DETAILS

Digonce required a slightly modified version of the BIND resolver(3)library. As of BIND 4.9, BIND's resolver has been augmented to workproperly with dig . Essentially, digis a straight-forward(albeit not pretty) effort of parsing arguments and setting appropriateparameters. Diguses resolver(3)routines Fn res_init , Fn res_mkquery ,Fn res_send as well as accessing the Ft _res structure.  

ENVIRONMENT

LOCALRES
file to use in place of Pa /etc/resolv.conf
LOCALDEF
default environment file

See also the explanation of the-envsav -envset , and-[no ]stickoptions, above. 

FILES

/etc/resolv.conf       
initial domain name and name server addresses
./DiG.env
default save file for default options

 

SEE ALSO

named(8),resolver(3),resolver(5),nslookup(8). 

STANDARDS

RFC 1035. 

AUTHOR

Steve Hotz hotzAATTisi.edu 

ACKNOWLEDGMENTS

Diguses functions from nslookup(8)authored by Andrew Cherenson. 

BUGS

Dighas a serious case of "creeping featurism" -- the result ofconsidering several potential uses during it's development. It wouldprobably benefit from a rigorous diet. Similarly, the print flagsand granularity of the items they specify make evident theirrather ad hoc genesis.

Digdoes not consistently exit nicely (with appropriate status)when a problem occurs somewhere in the resolver Po Sy NOTE: most of the common exit cases are handledPc . This is particularly annoying when running inbatch mode. If it exits abnormally (and is not caught), the entirebatch aborts; when such an event is trapped, digsimplycontinues with the next query.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OTHER OPTIONS
DETAILS
ENVIRONMENT
FILES
SEE ALSO
STANDARDS
AUTHOR
ACKNOWLEDGMENTS
BUGS

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector