Slow Booting? Include RHEL/CentOS Linux hostname in /etc/hosts file

In a classroom or lab environment, it is easy to create non-typical situations and cause RHEL/CentOS Linux to behave badly. Such was the case over the past week for one of my personal lab servers. The server is stand alone and does not belong to a domain. It is not configured as a DNS or DHCP server at the present time.

A couple of weeks ago I was configuring Samba on the server in question. After I was finished with the configuration change, I noticed it took this box a really long time to boot up. The boot sequence hung on sendmail. Once the server was up and running, xorg X server was very slow and sluggish. I could not get a gnome-terminal to open at all. Using a virtual console or a remote ssh shell was no problem.

After days of on and off head scratching, and more than one Google search, I finally realized that I had changed the hostname on this server in the /etc/sysconfig/network file, but NOT in the local /etc/hosts file. Since the hostname was not included in any DNS zone file, some services that needed to resolve the hostname to an IP address were very unhappy. By simply adding the new hostname to the line in the /etc/hosts file everything started working fine again.

I am sharing this insight with the hope that other RHEL/CentOS administrators will be able to save some time if this happens to them.

Share This Post

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.