| Lesson 11 || Single Machine Host Names|
| Objective ||Two ways that a Single Machine receives its host names |
Two ways that Single Machine receives its Host Names
Question: What are two ways that a single machine receives its host names?
A single machine receives its host names from more than one place. First, there is the host name returned by the
host$ uname -n
This host name is set using the
hostname command; only root can do this:
host# hostname splinter.acme.com
The name service
Another potential source of host name is the name service, whether from /etc/hosts, DNS, or NIS/NIS+. If you want these names to be the same, you have to make sure they agree with one another.
On Linux machines, the
hostname command takes options that make it clear which name you are asking about; for example, the name obtained from the resolver library is obtained from
host# hostname -f
Most UNIX machines do not offer this option to
hostname, and leave it up to you to remember where the name is coming from.