1

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 ...
Bart De Vos
  • 17,911
  • 6
  • 63
  • 82
fl00r
  • 575
  • 2
  • 7
  • 20

2 Answers2

2

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

womble
  • 96,255
  • 29
  • 175
  • 230
1

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.

user9517
  • 115,471
  • 20
  • 215
  • 297