Biz Connection FREE TRIAL + $75 GOOGLE ADWORD - FREE VOUCHER for YOU!

Hostname on RedHat (CentOS)

Having it setup properly you will avoid problems when you start apache and sendmail for example.

1) Check hostname:

#uname

2) Configure /etc/hosts
Add the following line(s) to this file

a) If theIP is assigned by DHCP

127.0.0.1 boxname.boxdomain.com localhost.localdomain localhost boxname

b) If theIP is static for example 172.20.10.1

127.0.0.1 localhost.localdomain localhost
172.20.10.1 boxname.boxdomain.com boxname

3) Set hostname in /etc/sysconfig/network
Add the following line:
HOSTNAME= boxname.boxdomain.com

4) Set hostname using hostname command (just for actual session, untill restart)
#hostname boxname.boxdomain.com

5) Set hostname in /proc/sys/kernel/hostname
#echo boxname.boxdomain.com > /proc/sys/kernel/hostname

Random article

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Comment