This question already has an answer here:

Here is the problem: we host our website with an external provider that doesn't give us an IP address, rather, they give us a domain where we point our www CNAME record to. I assume they are using some type of virtual hosting that reads the header for the requested domain and displays that website.

Anyway, a lot of our users complain the website is down when it actually is not because they are typing instead of into their browsers.

Is there a way to make this work in our DNS?

marked as duplicate by voretaq7 Sep 24 '13 at 16:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Do you control the DNS for the domain, or is that handled by the hosting provider? – Alex May 26 '11 at 15:24
up vote 10 down vote accepted

CNAME'ing your root is generally a bad idea, as all of the other records on the root (SOA, NS, MX) tend to be pretty important.

Your provider should really be allowing you to point to an address instead of a name. I appreciate what they're trying to do, giving themselves more flexibility to mess with that DNS entry as needed, but in this case it's counterproductive.

  • You're right, we can't CNAME our root because of the other records. Unfortunately, the provider will not provide an IP address for our site (even though we pay good money for them to host it). Is there any other way to have http traffic going to to be redirected to on our end? – Ryan Mortier May 26 '11 at 15:39
  • 2
    Well, yes, but it's not a good solution. You could put up an HTTP server somewhere that you point to via an A record on the root, which will then send a 301 redirect on all incoming requests to send them to But, that makes no sense from a financial perspective, when you're already paying good money for hosting. Try explaining the situation to your provider, they may see the error of their ways.. – Shane Madden May 26 '11 at 15:43

OK, this was asked some time ago, and there is already an accepted answer...

CNAME'ing your root is generally a bad idea,

You must not use a CNAME for your root domain.

users complain the website is down [..] because they are typing instead of

There is a simple solution:

  • Point at the IP address (A Record) of a webserver,
  • which sends out an HTTP 301 redirect to your address.

This redirect takes at most perhaps two hundred milliseconds, and most users never notice it.

You can do this yourself, by setting up a webserver and a few lines of PHP / ASP / .HTACCCES etc. Note, this doesn't have to be your main production webserver; any cheap shared webhost with a static IP address will do.

Alternatively, many DNS hosting providers have this as a free-of-charge service. This would be the simplest & most robust option; leave it to someone specialized in this to host this redirect. Different DNS hosts tend to call this functionality by different names, for example Gandi calls it "Web Forwarding".

Is there a way to make this work in our DNS?

You mean, purely in DNS without using a webserver? No, there is not.

Assuming the IP the CNAME resolves to doesn't change often and there isn't anything too fancy happening (e.g. geo-based load balancing, use of CDNs, etc.) you could "cheat" and add an A RR for with the IP the CNAME resolves to. I'd set up automated monitoring and changing of the A records so that if the IP does change it will be handled automatically (and you'd probably want a low TTL on the RR as well).

Unfortunately Alex's consideration would still apply: you'd need to configure the web server to do the right thing when the Host: header is rather than

Regarding Shane Madden's comment about setting up another web server to do the redirects: some DNS providers have this service. For example, DynDNS has "WebHops." You'd create an A record for with IP and then create a "webhop" that will redirect to

In the end, it may be time to get a new web hosting service that has the features you need.

After my question, the more I thought about it, it sounds like you do own the DNS for the zone. The problem is going to be, if they have a virtualhost setup for, it will not answer for In order to make that work, you'd have to have something else answering for, and have the webserver do a redirect to

  • We do have full control of the zone file for our domain name, unfortunately we do not have any access to the web server itself. Bummer :( – Ryan Mortier May 26 '11 at 15:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.