42foo: all the virtual hosts you need for your web development

I’ve done a fair amount of web “design” (mostly implementing designs of others) and development in the past, I usually set up a lot of virtual hosts in my local apache. I’ve done that in three different ways.

The quick&dirty hosts file

Point any of your development domains to in the /etc/hosts file. It’s the easiest way, but you need to add them one by one. At some point, mine could look like this: warp.dev ebox-platform.dev ebox-technologies.dev jorgebernal.dev projectA.dev
# ... and so on

Getting smart with dnsmasq

This is a more automated method. You install dnsmasq and configure as your DNS server. Then add this to your conf:


This worked well, and acted as a dns cache. But I had some trouble with dynamic dns entries at our old office: projects.warp.es would point to a local address inside the office and our remote IP from outside, so I found myself clearing the cache too often.

42foo: the zero-code web service

So I made it external. I bought 42foo.com and set up a bind zone with this:

@                       A
*                       A

So warp.42foo.com, ebox-platform.42foo.com or whateveryourprojectis.42foo.com always point to

You still have to set up the virtual host, but there is one step less for web development. Feel free to use it, and let me know if you set up something similar with a shorter domain name🙂

9 thoughts on “42foo: all the virtual hosts you need for your web development

  1. Thanks for the notes. I’ve tried to find different ways to handle this. I eventually found the /etc/hosts file easy enough to script adding/removing entries from. I have an addwebhost script that just appends the dns and copies a template vhost file into apache’s config.

  2. The problem herein lies that I, and also most people I’ve talked to about this, don’t use, but their LAN IP – so that you can have other machines and colleagues access that as well.

    Which doesn’t really make it easier, or even possible if you have dhcp with a low lease time, but still I found myself editing the hosts file too often to even start with the approach😛

  3. Pingback: Local development – multiple vhosts - NiGhTHawK

Comments are closed.