Table of Contents

NAME

host - look up host names using domain server

SYNOPSIS

host [-l] [-v] [-w] [-r] [-d] [-t querytype] [-a] host [server ]

DESCRIPTION

Host looks for information about Internet hosts. It getsthis information from a set of interconnected servers thatare spread across the country. By default, it simply convertsbetween host names and Internet addresses. Howeverwith the -t or -a options, it can be used to find all ofthe information about this host that is maintained by thedomain server.

The arguments can be either host names or host numbers.The program first attempts to interpret them as host numbers.If this fails, it will treat them as host names. Ahost number consists of first decimal numbers separated bydots, e.g. 128.6.4.194 A host name consists of names separatedby dots, e.g. topaz.rutgers.edu. Unless the nameends in a dot, the local domain is automatically tacked onthe end. Thus a Rutgers user can say «host topaz", and itwill actually look up «topaz.rutgers.edu". If this fails,the name is tried unchanged (in this case, «topaz"). Thissame convention is used for mail and other network utilities.The actual suffix to tack on the end is obtained bylooking at the results of a «hostname» call, and usingeverything starting at the first dot. (See below for adescription of how to customize the 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. thedomain system looks in a separate set of databases used toconvert numbers to names.

The second argument is optional. It allows you to specifya particular server to query. If you don't specify thisargument, the default server (normally the local machine)is used.

If a name is specified, you may see output of three differentkinds. Here is an example that shows all of them:% host sun4
sun4.rutgers.edu is a nickname for ATHOS.RUTGERS.EDUATHOS.RUTGERS.EDU has address 128.6.5.46ATHOS.RUTGERS.EDU has address 128.6.4.4ATHOS.RUTGERS.EDU mail is handled by ARAMIS.RUTGERS.EDUThe user has typed the command «host sun4". The firstline indicates that the name «sun4.rutgers.edu» is actuallya nickname. The official host name is«ATHOS.RUTGERS.EDU'. The next two lines show the address.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 ownmail. Mail for it is taken by ARAMIS.RUTGERS.EDU. Theremay be more than one such line, since some systems havemore than one other system that will handle mail for them.Technically, every system that can receive mail is supposedto have an entry of this kind. If the systemreceives its own mail, there should be an entry the mentionsthe system itself, for example «XXX mail is handledby XXX". However many systems that receive their own maildo not bother to mention that fact. If a system has a«mail is handled by» entry, but no address, this indicatesthat it is not really part of the Internet, but a systemthat is on the network will forward mail to it. Systemson Usenet, Bitnet, and a number of other networks haveentries of this kind.

There are a number of options that can be used before thehost name. Most of these options are meaningful only tothe staff who have to maintain the domain database.

The option -w causes host to wait forever for a response.Normally it will time out after around a minute.

The option -v causes printout to be in a «verbose» format.This is the official domain master file format, which isdocumented in the man page for «named". Without thisoption, output still follows this format in general terms,but some attempt is made to make it more intelligible tonormal 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 notshown.

The option -r causes recursion to be turned off in therequest. This means that the name server will return onlydata it has in its own database. It will not ask otherservers for more information.

The option -d turns on debugging. Network transactionsare shown in detail.

The option -t allows you to specify a particular type ofinformation to be looked up. The arguments are defined inthe man page for «named". Currently supported types area, ns, md, mf, cname, soa, mb, mg, mr, null, wks, ptr,hinfo, minfo, mx, uinfo, uid, gid, unspec, and the wildcard,which may be written as either «any» or «*". Typesmust be given in lower case. Note that the default is tolook first for «a", and then «mx", except that if the verboseoption is turned on, the default is only «a".

The option -a (for «all") is equivalent to «-v -t any".

The option -l causes a listing of a complete domain. E.g.host -l rutgers.edu
will give a listing of all hosts in the rutgers.edudomain. The -t option is used to filter what informationis presented, as you would expect. The default is addressinformation, which also include PTR and NS records. Thecommand
host -l -v -t any rutgers.edu
will give a complete download of the zone data for rutgers.edu,in the official master file format. (Howeverthe SOA record is listed twice, for arcane reasons.)NOTE: -l is implemented by doing a complete zone transferand then filtering out the information the you have askedfor. This command should be used only if it is absolutelynecessary.

CUSTOMIZING HOST NAME LOOKUP

In general, if the name supplied by the user does not haveany dots in it, a default domain is appended to the end.This domain can be defined in /etc/resolv.conf, but isnormally derived by taking the local hostname after itsfirst dot. The user can override this, and specify a differentdefault domain, using the environment variableLOCALDOMAIN. In addition, the user can supply his ownabbreviations for host names. They should be in a fileconsisting of one line per abbreviation. Each line containsan abbreviation, a space, and then the full hostname. This file must be pointed to by an environmentvariable HOSTALIASES, which is the name of the file.

See Also

named (8)

BUGS

Unexpected effects can happen when you type a name that isnot part of the local domain. Please always keep in mindthe fact that the local domain name is tacked onto the endof every name, unless it ends in a dot. Only if thisfails is the name used unchanged.

The -l option only tries the first name server listed forthe domain that you have requested. If this server isdead, you may need to specify a server manually. E.g. toget a listing of foo.edu, you could try «host -t nsfoo.edu» to get a list of all the name servers forfoo.edu, and then try «host -l foo.edu xxx» for all xxx onthe list of name servers, until you find one that works.


Table of Contents


www.fiveanddime.net


Google
Web www.fiveanddime.net