📄 host.1
字号:
.\" ++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--.\" $Id: host.1,v 4.9.1.1 1993/05/02 23:50:13 vixie Rel vixie $.TH HOST 1.SH NAMEhost \- look up host names using domain server.SH SYNOPSIS host [-l] [-v] [-w] [-r] [-d] [-t querytype] [-a] host [ server ] .SH DESCRIPTION .I Hostlooks for information about Internet hosts. It gets this informationfrom a set of interconnected servers that are spread across thecountry. By default, it simply converts between host names andInternet addresses. However with the -t or -a options, it can be usedto find all of the information about this host that is maintainedby the domain server..PPThe arguments can be either host names or host numbers. The programfirst attempts to interpret them as host numbers. If this fails,it will treat them as host names. A host number consists offirst decimal numbers separated by dots, e.g. 128.6.4.194A host nameconsists of names separated by dots, e.g. topaz.rutgers.edu. Unless the name ends in a dot, the local domainis automatically tacked on the end. Thus a Rutgers user can say"host topaz", and it will actually look up "topaz.rutgers.edu".If this fails, the name is tried unchanged (in this case, "topaz").This same convention is used for mail and other network utilities.The actual suffix to tack on the end is obtainedby looking at the results of a "hostname" call, and using everythingstarting at the first dot. (See below for a description ofhow to customize the host name lookup.) .PPThe first argument is the host name you want to look up.If this is a number, an "inverse query" is done, i.e. the domainsystem looks in a separate set of databases used to convert numbersto names..PPThe second argument is optional. Itallows you to specify a particular server to query. If you don'tspecify this argument, the default server (normally the local machine)is used..PPIf a name is specified, you may see output of three different kinds.Here is an example that shows all of them:.br % host sun4.br sun4.rutgers.edu is a nickname for ATHOS.RUTGERS.EDU.br ATHOS.RUTGERS.EDU has address 128.6.5.46.br ATHOS.RUTGERS.EDU has address 128.6.4.4.br ATHOS.RUTGERS.EDU mail is handled by ARAMIS.RUTGERS.EDU.brThe user has typed the command "host sun4". The first line indicatesthat the name "sun4.rutgers.edu" is actually a nickname. The officialhost name is "ATHOS.RUTGERS.EDU'. The next two lines show theaddress. If a system has more than one network interface, therewill be a separate address for each. The last line indicatesthat ATHOS.RUTGERS.EDU does not receive its own mail. Mail forit is taken by ARAMIS.RUTGERS.EDU. There may be more than onesuch line, since some systems have more than one other systemthat will handle mail for them. Technically, every system thatcan receive mail is supposed to have an entry of this kind. Ifthe system receives its own mail, there should be an entrythe mentions the system itself, for example"XXX mail is handled by XXX". However many systems that receivetheir own mail do not bother to mention that fact. If a systemhas a "mail is handled by" entry, but no address, this indicatesthat it is not really part of the Internet, but a system that ison the network will forward mail to it. Systems on Usenet, Bitnet,and a number of other networks have entries of this kind..PPThere are a number of options that can be used before thehost name. Most of these options are meaningful only to thestaff who have to maintain the domain database..PPThe option -w causes host to wait forever for a response. Normallyit will time out after around a minute..PPThe option -v causes printout to be in a "verbose" format. Thisis the official domain master file format, which is documented in the man page for "named". Without this option, output still followsthis format in general terms, but some attempt is made to make itmore intelligible to normal users. Without -v,"a", "mx", and "cname" recordsare written out as "has address", "mail is handled by", and"is a nickname for", and TTL and class fields are not shown..PPThe option -r causes recursion to be turned off in the request.This means that the name server will return only data it has inits own database. It will not ask other servers for more information..PPThe option -d turns on debugging. Network transactions are shownin detail..PPThe option -t allows you to specify a particular type of informationto be looked up. The arguments are defined in the man page for"named". Currently supported types are a, ns, md, mf, cname,soa, mb, mg, mr, null, wks, ptr, hinfo, minfo, mx, uinfo,uid, gid, unspec, and the wildcard, which may be writtenas either "any" or "*". Types must be given in lower case.Note that the default is to look first for "a", and then "mx", exceptthat if the verbose option is turned on, the default is only "a"..PPThe option -a (for "all") is equivalent to "-v -t any"..PPThe option -l causes a listing of a complete domain. E.g..br host -l rutgers.edu.brwill give a listing of all hosts in the rutgers.edu domain. The -toption is used to filter what information is presented, as you would expect. The default is address information, which alsoinclude PTR and NS records. The command.br host -l -v -t any rutgers.edu.brwill give a complete download of the zone data for rutgers.edu,in the official master file format. (However the SOA record islisted twice, for arcane reasons.) NOTE: -l is implemented bydoing a complete zone transfer and then filtering out the informationthe you have asked for. This command should be used only if itis absolutely necessary..SH CUSTOMIZING HOST NAME LOOKUPIn general, if the name supplied by the user does nothave any dots in it, a default domain is appended to the end.This domain can be defined in /etc/resolv.conf, but is normally derivedby taking the local hostname after its first dot. The user can overridethis, and specify a different default domain, using the environmentvariable.IR LOCALDOMAIN .In addition, the user can supply his own abbreviations for host names.They should be in a file consisting of one line per abbreviation.Each line contains an abbreviation, a space, and then the fullhost name. This file must be pointed to by an environment variable.IR HOSTALIASES ,which is the name of the file..SH "See Also"named (8).SH BUGSUnexpected effects can happen when you type a name that is notpart of the local domain. Please always keep in mind thefact that the local domain name is tacked onto the end of everyname, unless it ends in a dot. Only if this fails is the nameused unchanged..PPThe -l option only tries the first name server listed for thedomain that you have requested. If this server is dead, youmay need to specify a server manually. E.g. to get a listingof foo.edu, you could try "host -t ns foo.edu" to get a listof all the name servers for foo.edu, and then try "host -l foo.edu xxx"for all xxx on the list of name servers, until you find one thatworks.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -