MAN page from Other bind-utils-8.2.3-1.i386.rpm
HOST
Section: User Commands (1)
IndexBSD mandoc
BSD 4
NAME
host - look up host names using domain server
SYNOPSIS
host [-
l][-
v][-
w][-
r][-
d][-
t querytype][-
a ]
host [
server ]
DESCRIPTION
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.
The 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 name consists 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
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(1)call, and using everythingstarting at the first dot. (See below for a description ofSx CUSTOMIZING HOST NAME LOOKUP . )
The 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.
The 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.
If a name is specified, you may see output of three different kinds.Here is an example that shows all of them:
sun4.rutgers.edu is a nickname for ATHOS.RUTGERS.EDU
ATHOS.RUTGERS.EDU has address 128.6.5.46
ATHOS.RUTGERS.EDU has address 128.6.4.4
ATHOS.RUTGERS.EDU mail is handled by ARAMIS.RUTGERS.EDU
The user has typed the command ``host sun4 . ''The first line indicates that the name ``sun4.rutgers.edu ''is actually a nickname. The official host 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,
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.
OPTIONS
There 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.
- -w
- This causes host to wait forever for a response. Normallyit will time out after approximate one minute.
- -v
- Use "verbose" format for printout. Thisis the official domain master file format, which is documented in the man page for named(8).Without this option, output still followsthis format in general terms, but some attempt is made to make itmore intelligible to normal users. Without ``-v'' any "a", "mx", and "cname" recordsare written out as "has address", "mail is handled by", and"is a nickname for" (respectively), and TTL and class fields are not shown.
- -r
- Turn off recursion 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.
- -d
- Turn on debugging. Network transactions are shown in detail.
- -s
- Chase signatures back to parent key (DNSSEC).
- -t querytype
- Allows you to specify a particular querytype of informationto be looked up. The arguments are defined in the man page fornamed(8).Currently-supported types include: ``a , ''``ns , ''``md , ''``mf , ''``cname'' ``soa , ''``mb , ''``mg , ''``mr , ''``null , ''``wks , ''``ptr , ''``hinfo , ''``minfo , ''``mx , ''``uinfo'' ``uid , ''``gid , ''``unspec . ''Additionally, the wildcard, which may be writtenas either ``any ''or ``*'' can be used to specify any (all) of the above types. Types must be given in lower case.Note that the default is to look first for ``a , ''and then ``mx , ''except that if the verbose option is turned on, the default is only ``a'' The``-t''option is particularly useful for filtering information returned by host see the explanation of the``-l''option, below, for more information.
- -a
- ``all'' this is equivalent to ``-v -t any''
- -l
- List a complete domain; e.g.:
will give a listing of all hosts in the rutgers.edu domain. The ``-t''option 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
will 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.
CUSTOMIZING HOST NAME LOOKUP
In 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
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. The name file must be contained in the
HOSTALIASES environment variable.
ENVIRONMENT
- HOSTALIASES
- Name of file containing(host alias , full hostname)pairs.
FILES
- /etc/resolv.conf
- Seeresolver(5).
- HOSTALIASES
- Name of file containing(host alias , full hostname)pairs.
SEE ALSO
named(8),
resolver(5).
BUGS
Unexpected 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.
The ``-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
to get a list of all the name servers for foo.edu, and then try
for all ``xxx ''on the list of name servers, until you find one that works.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- OPTIONS
- CUSTOMIZING HOST NAME LOOKUP
- ENVIRONMENT
- FILES
- SEE ALSO
- BUGS
This document was created byman2html,using the manual pages.