Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Can I set access to all subdomains in my local domain in etc/hosts file?

Like       localhost *.domain.local

Now it looks like       localhost domain.local mail.domain.local web.domain.local other.domain.local ...
share|improve this question
up vote 2 down vote accepted

No, wildcards are a DNS lookup thing; trying to do the same thing in your /etc/hosts doesn't work. Sorry.

share|improve this answer
Ok, got it, thank you again – fl00r Aug 11 '11 at 8:52

No, you cant do that in your hosts file. You should though be able to setup dnsmasq quite easilly to do this. Adding


to the dnsmasq.conf file should do what you want.

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.