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

Like

127.0.0.1       localhost *.domain.local

Now it looks like

127.0.0.1       localhost domain.local mail.domain.local web.domain.local other.domain.local ...
link|improve this question

feedback

2 Answers

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.

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

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

address=/domain.local/127.0.0.1

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.