I use "lvh.me" - it has a wildcard DNS record to redirect any subdomain to localhost. So I'll use something like "example.com.lvh.me" to test.
I wrote - <a href="http://invoker.codemancers.com/" rel="nofollow">http://invoker.codemancers.com/</a> for similar use. It provides easy to use `.dev` local domain support and then ability to manage multiple processes via a Procfile or custom ini file.
I've been doing this for about a year or so now and its honestly the best solution for local development I've used in my career.<p>Recently I've started using Vagrant for more complex sites that require custom server software, or are based outside the traditional LAMP stack, but a Dnsmasq based setup on my mac is still my favorite for most sites.
I've been experimenting with this lately. I have been using dnsmasq to server up domains in my /etc/hosts file to local virtual machines for testing on different platforms without having to mess around with the hosts file in each virtual machine.<p>I am about to loop back around to a mobile project and I am hoping I can use it to tests my mobile app interactions with my local development box more easily than I have been able to in the past.
Another neat "trick" with dnsmasq is to redirect all the dns request for your domain to your dns provider when you're working with dns records (config needed: server=/example.com/176.124.112.100). Never wait for dns propagation anymore! Beat switching your system's dns to your provider because those could be slow for you, or could not answer domains that aren't in their database.
I do something similar with Ubuntu 12.04/14.04 which uses Dnsmasq via the NetworkManager service. These steps help make Dnsmasq a little more useful - reading /etc/hosts and allowing it to listen on your hosts IP address for use in guest VM's<p><a href="https://gist.github.com/magnetikonline/6236150" rel="nofollow">https://gist.github.com/magnetikonline/6236150</a>
Or you could use ettercap to redirect all DNS requests for any device on your local network. That's how I test iPhone, iPad, and Android applications when the services needed don't have DNS entries: <a href="http://joseph.by/post/83414951259/effectively-edit-hosts-file-with-ettercap-on-mac" rel="nofollow">http://joseph.by/post/83414951259/effectively-edit-hosts-fil...</a>
Great article for highlighting the dnsmasq on OSX idea. I wasn't aware that you could run this there.<p>On the goal of having unlimited easy to configure real domains that point to locahost, another service of interst is localtest.me [1]. This offers *.localtest.me -> 127.0.0.1<p>[1]: <a href="http://readme.localtest.me/" rel="nofollow">http://readme.localtest.me/</a>
One problem I've been running into: I have a virtual machine (linux running in vmware fusion on osx). I have dev.site.com in /etc/hosts. The vm is set to use a private network on the vm (as I don't want the ip address to change when I switch networks). How can I setup my phone to load dev.site.com and have it work while keeping the private network setup?
Doesn't do the exact same (you'd have to add a new entry everytime, rather than point *.dev to localhost) but <a href="https://addons.mozilla.org/en-US/firefox/addon/hostadmin/" rel="nofollow">https://addons.mozilla.org/en-US/firefox/addon/hostadmin/</a> is easier to set up. It'll flush the dns cache everytime its changed.
I wrote a little post for myself on the same topic, detailing how to get this working on Linux (Ubuntu & variants). <a href="https://coderwall.com/p/6dgpsw" rel="nofollow">https://coderwall.com/p/6dgpsw</a>