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

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.it  nerto

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

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

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

1 Answer 1

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, nerto.it, eventlog.in, and eventlog.it, this should work: nerto.it eventlog.in eventlog.it nerto
share|improve this answer
The first field after the IP address is a 'cannonical name', so a fully qualified host name is usually preferred there (instead of the unqualified 'nerto'). –  Jacek Konieczny Jul 19 '11 at 13:01
Thanks, edited. –  Jez Jul 19 '11 at 13:24

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.