Monday, September 08, 2008

Configuring Your Linux Hostname

First, check your hostname to see if it's configured correctly.

uname -n
hostname -a

hostname -s

hostname -d

hostname -f

hostname

If the above isn't correct, follow these steps:


Configure /etc/hosts

Add any static IPs on as follows:

127.0.0.1       localhost
192.168.0.4 mybox.example.com mybox


Setting the hostname using 'hostname'

You can run the following command after updating your /etc/hosts:

hostname mybox.example.com


Checking /etc/hostaname

You can also check to see if that worked by looking at /etc/hostname and you should see

mybox.example.com

I found all this good stuff at cpqlinux.

It is also possible that you may need to reconfigure httpd.conf in /etc/apache2/httpd.conf such that it reads

ServerName yourservername

No comments: