📄 dig.1
字号:
.\" $Id: dig.1,v 4.9.1.2 1993/09/08 00:00:49 vixie Exp $.\".\" ++Copyright++ 1993.\" -.\" Copyright (c) 1993.\" The Regents of the University of California. All rights reserved..\" .\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\" -.\" Portions Copyright (c) 1993 by Digital Equipment Corporation..\" .\" Permission to use, copy, modify, and distribute this software for any.\" purpose with or without fee is hereby granted, provided that the above.\" copyright notice and this permission notice appear in all copies, and that.\" the name of Digital Equipment Corporation not be used in advertising or.\" publicity pertaining to distribution of the document or software without.\" specific, written prior permission..\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL.\" WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES.\" OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT.\" CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL.\" DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR.\" PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS.\" SOFTWARE..\" -.\" --Copyright--.\".\" Distributed with 'dig' version 2.0 from University of Southern.\" California Information Sciences Institute (USC-ISI)..\".\" dig.1 2.0 (USC-ISI) 8/30/90.\".\" Man page reformatted for this release by Andrew Cherenson.\" (arc@sgi.com).\".TH DIG 1 "August 30, 1990".SH NAMEdig \- send domain name query packets to name servers.SH SYNOPSIS.B dig .RI [ @\fIserver\fP ].I domain.RI [ "<query-type>" ].RI [ "<query-class>" ].RI [ "+<query-option>" ].RI [ "\-<dig-option>" ].RI [ "%comment" ].SH DESCRIPTION\fIDig\fP (domain information groper) is a flexible command line toolwhich can be used to gather information from the DomainName System servers. \fIDig\fP has two modes: simple interactive modewhich makes a single query, and batch which executes a query foreach in a list of several query lines. All query options areaccessible from the command line..PPThe usual simple use of \fIdig\fP will take the form:.sp 1 dig @server domain query-type query-class.sp 1where:.IP \fIserver\fP may be either a domain name or a dot-notationInternet address. If this optional field is omitted, \fIdig\fPwill attempt to use the default name server for your machine..sp 1\fBNote:\fP 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 \fIhave\fP to 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 \fIserver\fP itself can beresolved. See .IR resolver (5)for information on /etc/resolv.conf.(WARNING: Changing /etc/resolv.conf will affectthe standard resolver library and potentially severalprograms 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 (LOCALRES is specificto the \fIdig\fP resolver and not referenced by the standardresolver). If the LOCALRES variable is not set or the fileis not readable then /etc/resolv.conf will be used..IP \fIdomain\fPis the domain name for which you are requesting information.See OPTIONS [-x] for convenient way to specify inverse addressquery..IP \fIquery-type\fP 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:.sp 1.ta \w'hinfoXX'u +\w'T_HINFOXX'u.nfa T_A network addressany T_ANY all/any information about specified domainmx T_MX mail exchanger for the domainns T_NS name serverssoa T_SOA zone of authority recordhinfo T_HINFO host informationaxfr T_AXFR zone transfer (must ask an authoritative server)txt T_TXT arbitrary number of strings.fi.sp 1(See RFC 1035 for the complete list.).IP \fIquery-class\fPis the network class requested in the query. Ifomitted, the default is "in" (C_IN = Internet).The following classes are recognized:.sp 1.ta \w'hinfoXX'u +\w'T_HINFOXX'u.nfin C_IN Internet class domainany C_ANY all/any class information.fi.sp 1(See RFC 1035 for the complete list.).sp 1\fBNote:\fP"Any" can be used to specify a class and/or a type ofquery. \fIDig\fP will 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 "\-c" option (see below)..SH OTHER OPTIONS.IP "%ignored-comment""%" is used to included an argument that is simply notparsed. This may be useful if running \fIdig\fP in batchmode. Instead of resolving every @server-domain-name ina list of queries, you can avoid the overhead of doingso, and still have the domain name on the command lineas a reference. Example:.sp 1 dig @128.9.0.32 %venera.isi.edu mx isi.edu.sp 1.IP "\-<dig option>""\-" is used to specify an option which effects theoperation of \fIdig\fP. The following options are currentlyavailable (although not guaranteed to be useful):.RS.IP "\-x \fIdot-notation-address\fP"Convenient form to specify inverse address mapping.Instead of "dig 32.0.9.128.in-addr.arpa" one cansimply "dig -x 128.9.0.32"..IP "\-f \fIfile\fP"File for \fIdig\fP batch mode. The file contains a listof query specifications (\fIdig\fP command lines) whichare to be executed successively. Lines beginningwith ';', '#', or '\\n' are ignored. Other optionsmay still appear on command line, and will be ineffect for each batch query..IP "\-T \fItime\fP"Time in seconds between start of successivequeries when running in batch mode. Can be usedto keep two or more batch \fIdig\fP commands runningroughly in sync. Default is zero..IP "\-p \fIport\fP" Port number. Query a name server listening to anon-standard port number. Default is 53..IP "\-P[\fIping-string\fP]"After query returns, execute a .IR ping (8)commandfor response time comparison. This ratherunelegantly makes a call to the shell. The lastthree lines of statistics is printed for thecommand:.sp 1 ping \-s server_name 56 3.sp 1If the optional "ping string" is present, itreplaces "ping \-s" in the shell command..IP "\-t \fIquery-type\fP"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)..IP "\-c \fIquery-class\fP" 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)..IP "\-envsav"This flag specifies that the \fIdig\fP environment(defaults, print options, etc.), afterall of the arguments are parsed, should be savedto a file to become the default environment.Useful if you do not like the standard set ofdefaults and do not desire to include alarge number of options each time \fIdig\fP is used.The environment consists of resolver statevariable flags, timeout, and retries as well asthe flags detailing \fIdig\fP output (see below).If the shell environment variable LOCALDEF is setto the name of a file, this is where the default\fIdig\fP environment is saved. If not, the file"DiG.env" is created in the current working directory..sp 1\fBNote:\fP LOCALDEF is specific to the \fIdig\fP resolver,and will not affect operation of the standardresolver library..sp 1Each time \fIdig\fP is 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 filebefore any arguments are parsed..IP "\-envset"This flag only affectsbatch query runs. When "\-envset" isspecified on a line in a \fIdig\fP batch file,the \fIdig\fP environment after the arguments are parsed,becomes the default environment for the duration ofthe batch file, or until the next line which specifies"\-envset"..IP "\-[no]stick"This flag only affects batch query runs.It specifies that the \fIdig\fP environment (as read initiallyor set by "\-envset" switch) is to be restored before each query(line) in a \fIdig\fP batch file.The default "\-nostick" means that the \fIdig\fP environmentdoes not stick, hence options specified on a single linein a \fIdig\fP batch file will remain in effect forsubsequent lines (i.e. they are not restored to the"sticky" default)..RE.IP "+<query option>""+" is used to specify an option to be changed in thequery packet or to change \fIdig\fP output specifics. Manyof these are the same parameters accepted by .IR nslookup (1).If an option requires a parameter, the form is asfollows:.sp 1 +keyword[=value].sp 1Most keywords can be abbreviated. Parsing of the "+"options is very simplistic \(em a value must not beseparated from its keyword by white space. The followingkeywords are currently available:.sp 1.nf.ta \w'domain=NAMEXX'u +\w'(deb)XXX'uKeyword Abbrev. Meaning [default][no]debug (deb) turn on/off debugging mode [deb][no]d2 turn on/off extra debugging mode [nod2][no]recurse (rec) use/don't use recursive lookup [rec]retry=# (ret) set number of retries to # [4]time=# (ti) set timeout length to # seconds [4][no]ko keep open option (implies vc) [noko][no]vc use/don't use virtual circuit [novc][no]defname (def) use/don't use default domain name [def][no]search (sea) use/don't use domain search list [sea]domain=NAME (do) set default domain name to NAME[no]ignore (i) ignore/don't ignore trunc. errors [noi][no]primary (pr) use/don't use primary server [nopr][no]aaonly (aa) authoritative query only flag [noaa][no]sort (sor) sort resource records [nosor][no]cmd echo parsed arguments [cmd][no]stats (st) print query statistics [st][no]Header (H) print basic header [H][no]header (he) print header flags [he][no]ttlid (tt) print TTLs [tt][no]cl print class info [nocl][no]qr print outgoing query [noqr][no]reply (rep) print reply [rep][no]ques (qu) print question section [qu][no]answer (an) print answer section [an][no]author (au) print authoritative section [au][no]addit (ad) print additional section [ad]pfdef set to default print flagspfmin set to minimal default print flagspfset=# set print flags to # (# can be hex/octal/decimal)pfand=# bitwise and print flags with #pfor=# bitwise or print flags with #.fi.sp 1The retry and time options affect the retransmission strategy used by resolver library when sending datagram queries. The algorithm is as follows:.sp 1.in +5n.nffor i = 0 to retry \- 1 for j = 1 to num_servers send_query wait((time * (2**i)) / num_servers) endend.fi.in -5n.sp 1(Note: \fIdig\fP always uses a value of 1 for num_servers.) .SH DETAILS\fIDig\fP once required a slightly modified version of the BIND .IR resolver (3)library. BIND's resolver has (as of BIND 4.9) been augmented to workproperly with \fIDig\fP. Essentially, \fIDig\fP is a straight-forward(albeit not pretty) effort of parsing arguments and setting appropriateparameters. \fIDig\fP uses resolver routines res_init(), res_mkquery(),res_send() as well as accessing _res structure. .SH FILES.ta \w'/etc/resolv.confXX'u/etc/resolv.conf initial domain name and name server \./DiG.env default save file for default options.br addresses.SH ENVIRONMENTLOCALRES file to use in place of /etc/resolv.conf.brLOCALDEF default environment file.SH AUTHORSteve Hotz hotz@isi.edu.SH ACKNOWLEDGMENTS\fIDig\fP uses functions from .IR nslookup (1)authored by Andrew Cherenson..SH BUGS\fIDig\fP has 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..PP\fIDig\fP does not consistently exit nicely (with appropriate status)when a problem occurs somewhere in the resolver (NOTE: most of the commonexit cases are handled). 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, \fIdig\fP simplycontinues with the next query..SH SEE ALSOnamed(8), resolver(3), resolver(5), nslookup(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -