.\" Copyright (c) 1987, 1990, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" 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. .\" %%%LICENSE_END .\" .\" @(#)hostname.7 8.2 (Berkeley) 12/30/93 .\" $FreeBSD: src/share/man/man7/hostname.7,v 1.7 2004/07/03 18:29:23 ru Exp $ .\" .\" 2008-06-11, mtk, Taken from FreeBSD 6.2 and modified for Linux. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2012 Akihiro MOTOKI .\" all rights reserved. .\" Translated 2012-05-08, Akihiro MOTOKI .\" .TH HOSTNAME 7 2019\-05\-09 Linux "Linux Programmer's Manual" .SH 名前 hostname \- ホスト名の名前解決の説明 .SH 説明 ホスト名は、階層構造でドット区切りのサブドメインである。例えば、 "com" ドメインの "example" サブドメインのマシン "monet" は、 "monet.example.com" と表現される。 .PP Each element of the hostname must be from 1 to 63 characters long and the entire hostname, including the dots, can be at most 253 characters long. Valid characters for hostnames are \fBASCII\fP(7) letters from \fIa\fP to \fIz\fP, the digits from \fI0\fP to \fI9\fP, and the hyphen (\-). A hostname may not start with a hyphen. .PP ホスト名は、ネットワーククライアントやサーバのプログラムでは一般的に使用され、使用する際には名前からアドレスに変換しなければならない (一般的にはアドレスへの変換処理は \fBgetaddrinfo\fP(3) か (廃止予定の) \fBgethostbyname\fP(3) で行われる)。 .PP Hostnames are resolved by the NSS framework in glibc according to the \fBhosts\fP configuration in \fBnsswitch.conf\fP. The DNS\-based name resolver (in the \fBdns\fP NSS service module) resolves them in the following fashion. .PP ホスト名がドットを含まない単一要素で構成されていて、環境変数 \fBHOSTALIASES\fP にファイル名が設定されている場合、入力されたホスト名に マッチする文字列を検索するのに指定されたファイルが使用される。 そのファイルの各行は、ホワイトスペースで区切られた文字列 2 つで 構成され、各行の最初の文字列がホスト名のエイリアス (別名) で、 二番目の文字列がそのエイリアスに対応する完全なホスト名である。 解決するホスト名と一致するホスト名のエイリアス (ファイルの各行の最初の フィールド) が見つかれば、完全なホスト名に置き換えられ、 それ以上の変換処理は行わずに、そのホスト名で検索処理が行われる (ホスト名とエイリアスの照合では大文字、小文字の違いは無視される)。 .PP 入力されたホスト名の末尾がドットの場合、 末尾のドットは削除され、それ以上の処理は行われず、 (末尾のドットを削除した) 残りの名前で検索が行われる。 .PP If the input name does not end with a trailing dot, it is looked up by searching through a list of domains until a match is found. The default search list includes first the local domain, then its parent domains with at least 2 name components (longest first). For example, in the domain cs.example.com, the name lithium.cchem will be checked first as lithium.cchem.cs.example and then as lithium.cchem.example.com. lithium.cchem.com will not be tried, as there is only one component remaining from the local domain. The search path can be changed from the default by a system\-wide configuration file (see \fBresolver\fP(5)). .SH 関連項目 \fBgetaddrinfo\fP(3), \fBgethostbyname\fP(3), \fBnsswitch.conf\fP(5), \fBresolver\fP(5), \fBmailaddr\fP(7), \fBnamed\fP(8) .PP .UR http://www.ietf.org\:/rfc\:/rfc1123.txt IETF RFC\ 1123 .UE .PP .\" .SH HISTORY .\" Hostname appeared in .\" 4.2BSD. .UR http://www.ietf.org\:/rfc\:/rfc1178.txt IETF RFC\ 1178 .UE .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。