Friday, December 19, 2008

Host Names in Linux

Configure the Hostname

On the shoulders of giants, this an excerpt from very detailed post on postfix (smtp software) at

http://souptonuts.sourceforge.net/postfix_tutorial.html

The computer that these examples are taken from is "squeezel.squeezel.com", and it exists on IP address 192.168.1.81. The short name is just squeezel. Another computer, on IP address "192.168.1.155" is "tape.squeezel.com".

     /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.81 squeezel.squeezel.com squeezel
192.168.1.155 tape.squeezel.com tape

You may also want to edit "/etc/sysconfig/network" and add or check the following.

    HOSTNAME=squeezel.squeezel.com

Finally, to put all changes into effect now, run the following command with root privileges.

   $ hostname squeezel.squeezel.com

Some of the settings in the postfix "main.cf" file depend upon the hostname.

No comments:

Post a Comment