Linux: shortname stuck as "localhost" even though full hostname is correct
Posted
by DrStalker
on Server Fault
See other posts from Server Fault
or by DrStalker
Published on 2010-03-15T01:46:49Z
Indexed on
2010/03/15
1:50 UTC
Read the original article
Hit count: 354
I have a linux (CentOS 5.2) server with the name myserver.mycompnay.com, which is correctly returned when I run 'hostname'. When I run 'hostname -s' however it returns "localhost" which is causing some backup scripts to put stuff in a "localhost" directory instead of a "myserver" directory.
All of our other CentOS boxes correctly return the first part of their hostname when 'hostname -s', where do I go on this server to make it behave the same? Other than having "HOSTNAME=myserver.mycompnay.com" in /etc/sysconfig/network what should I be looking at?
© Server Fault or respective owner