Naked Domain Redirects Made Easy

If you build a lot of websites you will soon discover how annoying workin with A-Records can be. They point directly at an IP-Address, which unless its a load balancer is almost never what you want. Since I frequently work in cloud-based environments, IP Addresses often change when I want a new version of a server and this means the A-Record would no longer work.

Instead, I prefer to work with DNS and redirect based on CNAMEs, but this is impossible with the Apex/Root/Naked Domain. See Heroku’s article on The Limitations of DNS A-Records.

To handle this problem, I’ve been using an excellent and free service called WWWizer.com. They provide a free redirect from your naked domain to the WWW subdomain which you can then CNAME as needed.

All you have to do is point your naked domain’s A-Record to 174.129.25.170.

You could of course run this service yourself, but it’s nice to not have to run yet another server.

Comments