Home / Operating Systems / Linux / My hostname keeps reverting to localhost (or localhost.localdomain) - how can I permanently fix this?
My hostname keeps reverting to localhost (or localhost.localdomain) - how can I permanently fix this?
Last updated: 06/29/2009
This problem is becoming more of an issue because so many mail server anti-SPAM techniques check for proper "HELO" settings from your smtp (mail) server.
So if your mail server thinks it is "localhost.localdomain", you will find that some of your email gets blocked arbitrarily. Such is the status of the 'Net these days.
So, how to fix this permanently? Here are 2 steps that are guaranteed to fix your hostname problem.
Read all the articles about changing your /etc/hosts, /etc/hostname, /etc/resolv.conf, /etc/sysconfig/networks and other files. Try rebooting, and see if anything works. Try editing your Plesk configuration. You might get lucky, and get things fixed that way. Spend a few hours if you need to - take your time.