Wildcards hostname in your hosts file

If you've ever wanted to setup a wildcard entry in your hosts file so you don't have to add an entry for every IIS binding you'll be happy to know there is a way.

The trick however is not to use the hosts file but a local DNS proxy instead. Acrylic DNS is a free and open source which you can download here. You use it in much the same way you would use a hosts file.

Stackoverflow has a great answer detailing how to set it up:

Configuring Acrylic DNS Proxy

To configure Acrylic DNS Proxy, install it from the above link then go to:

  1. Start
  2. Programs
  3. Acrilic DNS Proxy
  4. Config
  5. Edit Custom Hosts File

Add the folowing lines on the end of the file:

127.0.0.1	*.localhost
127.0.0.1	*.local

Restart the Acrilic DNS Proxy service:

  1. Start
  2. Programs
  3. Acrilic DNS Proxy
  4. Config
  5. Restart Acrilic Service

You will also need to adjust your DNS setting in you network interface settings:

  1. Start
  2. Control Panel
  3. Network and Internet
  4. Network Connections
  5. Local Area Connection Properties
  6. TCP/IPv4

Set "Use the following DNS server address":

Preferred DNS Server: 127.0.0.1
Daniel LittleWritten by Daniel Little