Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The /etc/hosts file defaults your hostname to 127.0.1.1 rather than 127.0.0.1

127.0.0.1   localhost 
127.0.1.1   my_machine

I've already found out why. But that was giving me problems testing some web apps, which had hard-coded assumption, that local machine == 127.0.0.1. So I've change my hosts file to

127.0.0.1   localhost my_machine

Question is:

  • are there reasons for which 127.0.1.1 hack still valid?
  • if so, which software included in 11.04 might have problem with the change I've made?
share|improve this question
add comment

1 Answer

Your local machine IS 127.0.0.1. It's the standard IP for the localhost.

Instead, the hostname of your machine resolves to 127.0.1.1.

It should be no problem to change it to anything in the range 127.0.0.0/8 which is reserved for loopbacks.

As long as nothing listens on 127.0.1.1 you should be safe. To find if there's something listening on 127.0.1.1:

sudo netstat -tunelp | grep 127.0.1.1
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.