Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to redirect some sites to localhost. I can use hosts file which resides in directory C:\WINDOWS\system32\drivers\etc in windows.

Which is equivalent of this file in Ubuntu?

share|improve this question
Amusingly, the Windows hosts file is actually the equivalent of the Unix host file ; both files being kept in a folder called "etc" is a big clue. – Adrian Jul 22 '12 at 7:09
up vote 10 down vote accepted

In Ubuntu it is /etc/hosts. You can edit the file as same in other OSes.

share|improve this answer
What for then there is a resolve.conf in Ubuntu? – Green Jul 12 at 14:48

Your Answer


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.