Server Fault is a question and answer site for system and network administrators. 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 have a single IP ( and I would like to use /etc/hosts to associate multiple domains with that IP. Currently my hosts file looks like this:  nerto

I would like and to also be resolved to I tried making my hosts file look like this, but it didn't work the way I expected:  nerto  nerto  nerto

What it the proper setting to have in my /etc/hosts file so that nerto,,, and all resolve locally to

share|improve this question
that syntax is correct though – Mike Jul 19 '11 at 12:47

I don't understand why you have more than 1 line in the file for this IP. Assuming the 4 hostnames you want to access the IP via are nerto,,, and, this should work: nerto
share|improve this answer

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.