Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My /etc/hostname has:

name.domain.net

Previously, it was:

old.domain2.net

If I do hostame I get name.domain.net. But doing hostname -s returns old.

According to the man page:

   -s, --short
          Display the short host name. This is the host name cut at the first dot.

Which is not what I get. I have even rebooted the server.

Any ideas?

share|improve this question
add comment

1 Answer

Just happened to me on CentOS 5.7 and found out using strace. Btw what distro is it?

Your /etc/hosts probably still looks like:

127.0.0.1   old.domain2.net localhost localhost.localdomain

You should replace the FIRST entry there, which probably still points to the old name.

This might also be tuned by editing /etc/nsswitch.conf and /etc/host.conf, but probably not required.

share|improve this answer
add comment

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.