Open the /etc/sysconfig/network file with your favorite text editor. Modify the HOSTNAME= value to match your FQDN host name.

# nano /etc/sysconfig/network
HOSTNAME=myserver.domain.com

Change the host that is associated to your main IP address for your server, this is for internal networking (found at /etc/hosts):

nano /etc/hosts
192.xx.xx.xx myserver.domain.com

Hostname

The ‘hostname’ command will let you change the hostname on the server that the commandline remembers, but it will not actively update all programs that are running under the old hostname.

# hostname myserver.domain.com
# hostname
myserver.domain.com

Restart Networking

At this point all the necessary changes that needed to be made have been made, you will want to restart networking on your server to make sure that changes will be persistent on reboot:


# /etc/init.d/network restart

* Hostname reports nothing

# hostname

Try this


$ stat /bin/hostname
File: `/bin/hostname'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 803h/2051d Inode: 40616045 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2015-03-13 05:10:01.000000000 -0700
Modify: 2014-12-15 15:33:57.000000000 -0700
Change: 2014-12-15 15:33:57.000000000 -0700

Notice the “empty file”
Reinstall the package – the package it’s included in (net-tools-1.60-110.el6_2.x86_64).

Now Check

# stat /bin/hostname
  File: `/bin/hostname'
  Size: 17848           Blocks: 40         IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 269246      Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-03-13 04:47:35.065993289 -0600
Modify: 2012-05-10 03:17:33.000000000 -0500
Change: 2015-01-30 03:29:41.959201490 -0600

# service exim restart
Shutting down clamd:                                       [FAILED]
Shutting down exim:                                        [FAILED]
Shutting down spamd:                                       [FAILED]


# service exim status
exim dead but subsys locked

There may be 2 issues to check.

-The presence of /etc/eximdisable, just move this file to eximdisable-bak and restart exim

# mv /etc/eximdisable /etc/eximdisable-bak
# service exim restart
Shutting down clamd:                                       [FAILED]
Shutting down exim:                                        [FAILED]
Shutting down spamd:                                       [  OK  ]
Starting clamd:                                            [  OK  ]
Starting exim:                                             [  OK  ]
0 processes (antirelayd) sent signal 9
/usr/local/cpanel/scripts/update_sa_rules: running in background

-The server being out of disk space and/or inodes, use ‘df -h’ and ‘df -i’ to confirm.

Post fix restart produces the following

# tail -f /usr/local/psa/var/log/maillog
Mar  4 21:40:07 postfix/postfix-script[24660]: fatal: the Postfix mail system is not running
Mar  4 21:40:08 postfix/postfix-script[24731]: starting the Postfix mail system
Mar  4 21:40:08 postfix/master[24732]: fatal: bind 0.0.0.0 port 25: Address already in use

Look for multiple instances of smtp inet n – n – – smtpd and comment them out:


#smtp inet n - n - - smtpd
localhost:smtp inet n - n - - smtpd
smtp_bind_address6= -o smtp_address_preference=ipv4
#smtp inet n - n - - smtpd

Restart postfix

# service postfix restart

When you login to WHM and all the IP’s are missing.

If you have avahi improperly configured and running on your machine, it will withdraw the IPs on running either a) a reboot, or b) a network restart, so you can check you logs at /var/log/messages for avahi.
You can either stop avahi or properly register your IPs in avahi for these to be recognized. That service is what is causing the issue to occur.

Run the following to restore the IP addresses:

# /etc/rc.d/init.d/ipaliases restart

You may have to restart named to get DNS going again as well. Restart named again cause it cannot bind on the new IPs from ipaliases.

# service named restart

The issue of why is explained here:

https://forums.cpanel.net/threads/cpanel-loses-all-but-primary-ip-address.160393/