Zone apex, alternative to A record

binddomain-name-system

I am running a small hosting service and from time to time I have a new user using cloudflare.

To use cloudflare users

1) copy the DNS zone via the cloudflare interface

2) set cloudflare nameservers

In the DNS zone there is a bunch of A records such as

apex.com A 6.6.6.6

www A 6.6.6.6

However from time to time I need to move websites across servers with different IPs.

I would replace A records with CNAME records eg.

apex.com CNAME apex.hosting.com

www CNAME apex.hosting.com

if it weren't for the SOA/NS vs zone apex CNAME issue.

What alternative is open to overcome this problem at DNS zone level?

It's beyond me why I can't find a solution to such a problem at DNS zone level.

Load balancer/virtualization are not an option unfortunately.

Best Answer

There is a hosted option that provides for what Michael Hampton suggests above. It's called wwwizer.com.

Set your zone apex A record to this IP address and it provides a 301 redirect from the non-WWW version of your domain to the WWW version.

Just point your naked domain to 174.129.25.170 and it will be redirected to the same domain with www in front. Read more...

Amazon's CTO Werner Vogels used to use this for his own blog before Amazon S3 offered S3 Website Root Domain support. The Amazon Route53 DNS service has since started offering a special type of record called an 'alias record':

Additionally, Route 53 offers ‘Alias’ records (a Route 53-specific virtual record). Alias records are used to map resource record sets in your hosted zone to Elastic Load Balancing load balancers, CloudFront distributions, or S3 buckets that are configured as websites. Alias records work like a CNAME record in that you can map one DNS name (example.com) to another ‘target’ DNS name (elb1234.elb.amazonaws.com). They differ from a CNAME record in that they are not visible to resolvers. Resolvers only see the A record and the resulting IP address of the target record.

However, this only applies to Amazon customers. I frequently use wwwizer with domains I host via Rackspace Cloud DNS, and I'm very pleased with it.

Related Topic