1*0fae9dddSschwarze.\" $OpenBSD: hostname.7,v 1.11 2019/05/12 16:55:11 schwarze Exp $ 2df930be7Sderaadt.\" $NetBSD: hostname.7,v 1.4 1994/11/30 19:07:14 jtc Exp $ 3df930be7Sderaadt.\" 4df930be7Sderaadt.\" Copyright (c) 1987, 1990, 1993 5df930be7Sderaadt.\" The Regents of the University of California. All rights reserved. 6df930be7Sderaadt.\" 7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without 8df930be7Sderaadt.\" modification, are permitted provided that the following conditions 9df930be7Sderaadt.\" are met: 10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright 11df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer. 12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright 13df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer in the 14df930be7Sderaadt.\" documentation and/or other materials provided with the distribution. 1529295d1cSmillert.\" 3. Neither the name of the University nor the names of its contributors 16df930be7Sderaadt.\" may be used to endorse or promote products derived from this software 17df930be7Sderaadt.\" without specific prior written permission. 18df930be7Sderaadt.\" 19df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22df930be7Sderaadt.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29df930be7Sderaadt.\" SUCH DAMAGE. 30df930be7Sderaadt.\" 31df930be7Sderaadt.\" @(#)hostname.7 8.2 (Berkeley) 12/30/93 32df930be7Sderaadt.\" 33*0fae9dddSschwarze.Dd $Mdocdate: May 12 2019 $ 34df930be7Sderaadt.Dt HOSTNAME 7 35fc8533a3Saaron.Os 36df930be7Sderaadt.Sh NAME 37df930be7Sderaadt.Nm hostname 38df930be7Sderaadt.Nd host name resolution description 39df930be7Sderaadt.Sh DESCRIPTION 40df930be7SderaadtHostnames are domains, where a domain is a hierarchical, dot-separated 41df930be7Sderaadtlist of subdomains; for example, the machine monet, in the Berkeley 42df930be7Sderaadtsubdomain of the EDU subdomain of the Internet would be represented as 43df930be7Sderaadt.Pp 44df930be7Sderaadt.Dl monet.Berkeley.EDU 45df930be7Sderaadt.Pp 46df930be7Sderaadt(with no trailing dot). 47df930be7Sderaadt.Pp 48df930be7SderaadtHostnames are often used with network client and server programs, 49df930be7Sderaadtwhich must generally translate the name to an address for use. 50df930be7Sderaadt(This function is generally performed by the library routine 51df930be7Sderaadt.Xr gethostbyname 3 . ) 52df930be7SderaadtHostnames are resolved by the Internet name resolver in the following 53df930be7Sderaadtfashion. 54df930be7Sderaadt.Pp 55df930be7SderaadtIf the input name ends with a trailing dot, 56df930be7Sderaadtthe trailing dot is removed, 57df930be7Sderaadtand the remaining name is looked up with no further processing. 58df930be7Sderaadt.Pp 59df930be7SderaadtIf the input name does not end with a trailing dot, it is looked up 60df930be7Sderaadtby searching through a list of domains until a match is found. 61df930be7SderaadtThe default search list includes first the local domain, 62df930be7Sderaadtthen its parent domains with at least 2 name components (longest first). 63df930be7SderaadtFor example, 64df930be7Sderaadtin the domain CS.Berkeley.EDU, the name lithium.CChem will be checked first 65df930be7Sderaadtas lithium.CChem.CS.Berkeley.EDU and then as lithium.CChem.Berkeley.EDU. 66a8f174ddSderaadtLithium.CChem.EDU will not be tried, as there is only one component 67df930be7Sderaadtremaining from the local domain. 68df930be7SderaadtThe search path can be changed from the default 69df930be7Sderaadtby a system-wide configuration file (see 70df930be7Sderaadt.Xr resolv.conf 5 ) . 71df930be7Sderaadt.Sh SEE ALSO 72df930be7Sderaadt.Xr gethostbyname 3 , 73df930be7Sderaadt.Xr resolv.conf 5 , 74eeecef55Sjmc.Xr nsd 8 , 75eeecef55Sjmc.Xr unbound 8 76df930be7Sderaadt.Sh HISTORY 77230f84baSaaronA 78230f84baSaaron.Nm 79230f84baSaaronmanual page appeared in 80230f84baSaaron.Bx 4.2 . 81