Archive for January, 2008

Sub-domains and Developer Testing

Sometimes you sell accounts to your web application with unique sub-domain per license. This is a neat way of handling accounts and gives you lot control.

For e.g. lets say you have built hotel-reservations-engine in Ruby on Rails and are planning to license it for many different hotels. The best way to do that would be use sub-domains to your advantage. There are many blog posts that tells you how to achieve this on Ruby On Rails and the production server.

My focus is though, how to get this working in your developer machine without any dilly-dally of hosts file.

Use Name Server To Your Advantage:

For e.g. lets say you manage your DNS records with tinydns which has a great feature of wild-card alias, and you add the following entries…

after propagation its all yours: => => => =>

Note the * in the +* which does the trick.

No more editing the hosts file, and it works for all developers pointing to their own machine. Nice!