50 lines
2.1 KiB
HTML
50 lines
2.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
|
<!--Converted with LaTeX2HTML 96.1-c (Feb 29, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>Setting the Hostname</TITLE>
|
|
</HEAD>
|
|
<BODY LANG="EN">
|
|
<A HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A HREF="node63.html">Assigning IP-Addresses</A>
|
|
<B>Up:</B> <A HREF="node58.html">Configuring TCP/IP Networking</A>
|
|
<B> Previous:</B> <A HREF="node61.html">Another Example</A>
|
|
<BR> <P>
|
|
<H1><A NAME="SECTION007400000">Setting the Hostname</A></H1>
|
|
|
|
Most, if not all, network applications rely on the local host's
|
|
name having been set to some reasonable value. This is usually
|
|
done during the boot procedure by executing the hostname
|
|
command. To set the hostname to name, it is invoked as
|
|
<Pre>
|
|
# hostname name
|
|
</pre>
|
|
It is common practice to use the unqualified hostname without any
|
|
domain name for this. For instance, hosts at the Virtual Brewery might
|
|
be called vale.vbrew.com, vlager.vbrew.com, etc. These
|
|
are their official, fully qualified domain names. Their local
|
|
hostnames would be only the first component of the name, such as
|
|
vale. However, as the local hostname is frequently used to look
|
|
up the host's IP-address, you have to make sure that the resolver
|
|
library is able to look up the host's IP-address. This usually means
|
|
that you have to enter the name in /etc/hosts (see below).
|
|
<P>
|
|
<A NAME="2482"></A>
|
|
<A NAME="2528"></A>
|
|
<A NAME="2484"></A>
|
|
Some people suggest to use the domainname command to set the
|
|
kernel's idea of a domain name to the remaining part of the FQDN. In
|
|
this way you could combine the output from hostname and
|
|
domainname to get the FQDN again. However, this is at best
|
|
only half correct. domainname is generally used to set the
|
|
host's NIS domain, which may be entirely different from the DNS domain
|
|
your host belongs to. NIS is covered in chapter-<A HREF="node130.html#nis"><IMG ALIGN=BOTTOM ALT="gif" SRC="cross_ref_motif.gif"></A>.
|
|
<P>
|
|
<BR> <HR>
|
|
<P><ADDRESS>
|
|
<I>Andrew Anderson <BR>
|
|
Thu Mar 7 23:22:06 EST 1996</I>
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|