Table of Contents

NAME

hostname - host name resolution description

DESCRIPTION

Hostnames are domains. A domain is a hierarchical, dotseparatedlist of subdomains. For example, the machinemonet, in the Berkeley subdomain of the EDU subdomain ofthe Internet Domain Name System would be represented asmonet.Berkeley.EDU
(with no trailing dot).

Hostnames are often used with network client and serverprograms, which must generally translate the name to anaddress for use. (This task is usually performed by thelibrary routine gethostbyname(3).) The default method forresolving hostnames by the Internet name resolver is tofollow RFC 1535's security recommendations. Actions canbe taken by the administrator to override these recommendationsand to have the resolver behave the same as earlier,non-RFC 1535 resolvers.

The default method (using RFC 1535 guidelines) follows:

If the name consists of a single component, i.e. containsno dot, and if the environment variable ``HOSTALIASES'' isset to the name of a file, that file is searched for astring matching the input hostname. The file should consistof lines made up of two strings separated by whitespace,the first of which is the hostname alias, and thesecond of which is the complete hostname to be substitutedfor that alias. If a case-insensitive match is foundbetween the hostname to be resolved and the first field ofa line in the file, the substituted name is looked up withno further processing.

If there is at least one dot in the name, then the name isfirst tried as is. The number of dots to cause thisaction is configurable by setting the threshold using the``ndots'' option in /etc/resolv.conf (default: 1). If thename ends with a dot, the trailing dot is removed, and theremaining name is looked up (regardless of the setting ofthe `ndots' option) and no further processing is done.

If the input name does not end with a trailing dot, it islooked up by searching through a list of domains until amatch is found. If neither the search option in the/etc/resolv.conf file or the ``LOCALDOMAIN'' environmentvariable is used, then the search list of domains containsonly the full domain specified by the domain option (in/etc/resolv.conf) or the domain used in the local hostname(see hostname(1) and resolver(5)). For example, if the``domain'' option is set to CS.Berkeley.EDU, then onlyCS.Berkeley.EDU will be in the search list and will be theonly domain appended to the partial hostname, for example,``lithium'', making lithium.CS.Berkeley.EDU the only nameto be tried using the search list.

If the search option is used in /etc/resolv.conf or theenvironment variable, ``LOCALDOMAIN'' is set by the user,then the search list will include what is set by thesemethods. For example, if the ``search'' option containedCS.Berkeley.EDU CChem.Berkeley.EDU Berkeley.EDUthen the partial hostname (e.g., ``lithium'') will betried with each domainname appended (in the same orderspecified). The resulting hostnames that would be triedare:
lithium.CS.Berkeley.EDU
lithium.CChem.Berkeley.EDU
lithium.Berkeley.EDU

The environment variable ``LOCALDOMAIN'' overrides the``search'' and ``domain'' options, and if both search anddomain options are present in the resolver configurationfile, then only the last one listed is used (seeresolver(5)).

If the name was not previously tried ``as is'' (i.e., itfell below the ``ndots'' threshold or did not contain adot), then the name as originally provided is attempted.

SEE ALSO

gethostbyname(3), resolver(5), mailaddr(7), named(8)


Table of Contents


www.fiveanddime.net


Google
Web www.fiveanddime.net