Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

We'd like to set things up on our developers' Windows boxes such that all .dev domains resolve to localhost. On Unix systems, firing up dnsmasq with a single additional line to hosts would do it, but dnsmasq is sadly Unix-only. On the Windows side, I'm not aware of an equivalent solution, either built-in or available in a third-party utility. The best I've been able to come up with are some PowerShell scripts, running as administrator, that would alter c:\Windows\System32\Drivers\etc\hosts directly—ugly and error-prone at best.

What's the right way to do this? Does no solution meaningfully exist right now?

share|improve this question
I don't think the hosts files in Windows supports wildcards. You could do what TheFiddlerWins is suggesting and set a wildcard A record to, but yes it would go to all Windows clients using that DNS server. Probably doesn't matter since it is a .dev though. But mixing "production" and "development" is typically taboo. Why the need? Can't the dev peeps create their own entries as they build up a local site/server/host? – TheCleaner Sep 17 '13 at 15:58
The issue here is that there are a collection of sites (,, etc.) that talk to each other; we'd like to make it so that their location on the dev boxes is similar (,, which allows for consistency without editing the hosts file for each site. Making new virtual hosts in IIS would be sufficient. – Benjamin Pollack Sep 17 '13 at 16:06
up vote 3 down vote accepted

Do you have a .dev zone in DNS already? You can create a wildcard entry where *.dev goes to the loopback.

share|improve this answer
We don't; you're proposing doing this at the AD level, so that any machines on the domain would pick it up? – Benjamin Pollack Sep 17 '13 at 15:48
It's not really at the "AD" level, although if you use AD integrated DNS and create the zone as such it would work out that way - it would be for any machine that resolved against that DNS server(s). – TheFiddlerWins Sep 17 '13 at 17:22
Got it. That sounds a lot saner than doing this on each box. – Benjamin Pollack Sep 17 '13 at 19:06

Alternative: get your devs to just append, which is a public DNS zone that already exists (with a * A record) for this purpose.

share|improve this answer
I'm not sure that adding an untrusted public domain to your workflow is a great plan! – JamesRyan Jan 15 '14 at 23:48
If this concerns you, it would be simple to add a DNS test to whatever monitoring solution you use. If the DNS for has changed in the last second, make it blast an alert to your devs. – Ross Presser Jan 17 '14 at 16:20

I can recommend - all subdomains resolve to

share|improve this answer
I'm not sure that adding an untrusted public domain to your workflow is a great plan! – JamesRyan Jan 15 '14 at 23:48

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.