Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

An interesting situation:

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.domain.tld but is now identifying itself as otherhostname.domain.tld 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 127.0.1.1 for hostnamea.domain.tld

the thing is, there is another server called otherhostname.domain.tld. 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. 1 is on a static ip from a residential broadband provider and one is in a datacentre.

so any idea's what i've inadvertanly messed up?

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

3 Answers 3

up vote 1 down vote accepted

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
share|improve this answer
    
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

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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