| Lesson 11 | Single Machine Host Names |
| Objective | Two ways that a single machine receives its host names |
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 uname command:
A single machine receives its host names from more than one place. First, there is the host name returned by the uname command:
host$ uname -n splinter.acme.com
host# hostname splinter.acme.com
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
hostname -f:
host# hostname -f splinter.acme.com
Most UNIX machines do not offer this option to hostname, and leave it up to you to remember where the name is coming from.