Windows – How to resolve all .dev domains to localhost on Windows

dnsmasqdomain-name-systemwindows

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?

Best Answer

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

Related Topic