I have a server that has been working just fine with the correct hostname since i set it up several months ago, but now, it thinks it's hostname has changed.

It started as hostnamea.example.com but is now identifying itself as otherhostname.example.com. That is, the hostname at the beginning of the line in the shell is changed, the output of hostname -f is changed etc. the contents of /etc/hostname are still the same though. I have also checked /etc/hosts and there is an entry for for hostnamea.example.com

The thing is, there is another server called otherhostname.example.com. that server returns the correct information from hostname -f

I have checked and rechecked the DNS configuration and there is no error.

The two servers are on completely different networks from different ISPs. The first one is on a static IP address from a residential broadband provider and one is in a datacentre.

So, any idea's what I've inadvertently messed up?

  • can you please run the following command and pastebin the output? > strace hostname -f – Khushil Oct 7 '10 at 12:13

This has nothing to do with DNS. The host name usually is only set once when the network comes up. Someone probably changed it by accident, just change it back.

hostname hostnamea
  • Thanks - that worked, strange thing is i wouldn't have done that myself and no-one else is supposed to have access to the machine. – m3z Oct 8 '10 at 11:13

Out of curiosity, is there an incorrect /etc/hosts entry for one of the proper IP addresses assigned to your server? Or, barring that, an incorrect reverse lookup entry in your DNS server?

--Christopher Karel


Is it possible that someone simply changed it via "hostname otherhostname.domain.tld" by accident?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.