Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I've just signed up with a webhost (which I prefer not to name) and I'm reasonably happy with it. The only nit was when I was ready to put a site online and I asked the support line to what name I should point my 'www' CNAME to. They responded that they don't do that and I need to set my domain's NS records for the hosting to work.

"Why would you ever want to do it that way? Our service to you includes DNS and our servers are probably much better than the one your registrar provides."

This was a bit of surprise as all of the other webhosts I've worked with happily support this. I've set up (eg) gallery.myfriend.example for friends by having them configure their DNS to CNAME 'gallery' to the name of a shared server at a webhost and the webhost does name-based hosting for 'gallery.myfriend.example'.

(Of course, if the webhost ever tells me I'm being moved from A.webhost.example to B.webhost.example, it would be my responsibility to change where the CNAME points. Really good webhosts would instead create myname.webhost.example for the IP of whichever server my stuff happens to be on, so I'd never have to worry about keeping my CNAME up to date.)

Is my impression correct, that most webhosts will happily support a service that begins with a CNAME hosted elsewhere, or is it really more common that webhosts will only provide a service if they control the DNS service too?


For example

Alice is a customer, owning Alice.example.
BobHost, CarolHost and DaveHost are webhosts.

Alice has a domain registration, DNS hosting and website hosting with BobHost.
BobHost have the following DNS setup...
* Alice.example A 192.0.2.1
* Gallery.Alice.example CNAME SomeServer.CarolHost.example
and her main website content and email is served from 192.0.2.1.

Alice also has website hosting with CarolHost, but only to serve the 'Gallery' sub-domain. Her gallery content is served from SomeServer.CarolHost.example, but only when the 'Host:' header of a request is 'Gallery.Alice.example'.

Yes, this is sub-optimal, but its the only practical way to have a sub-domain hosted elsewhere from the main site. Frankly, it works. CarolHost can change the IP of 'SomeServer' whenever they like without having to inform anyone as long as they update their own DNS records. No-one complains to CarolHost that the gallery is off-line when the fault is with BobHost's DNS service failing to serve that CNAME record.

Continuing the story, Alice now wishes to put an additional sub-domain, 'Blog.Alice.example' to be hosted by DaveHost. She calls DaveHost support and asks how to host 'Blog' in the same way that 'Gallery' is hosted by CarolHost. DaveHost respond that they don't support this. If Alice wishes to use DaveHost's service, Alice will need to move DNS hosting to DaveHost.

My question; In the world of webhosting services, are hosts like DaveHost commonplace? (All but one the webhosts I've dealt with are happy to be CarolHost, even though they all really want to be like BobHost.)

share|improve this question
1  
Using cnames is suboptimal, other hosts have done that because it is the easiest way to deal with you, not because they are providing a better service. –  JamesRyan May 10 '12 at 15:21
    
To add to this, it's because your resolver would have to resolve two domain names rather than one, rather than the IP address it points to. This can create a slight (or in extreme cases, a long) delay in people being able to access your site. –  ionFish May 11 '12 at 22:25
    
Updated the question with an illustrative example. –  billpg May 30 '12 at 17:51
add comment

2 Answers 2

up vote 1 down vote accepted

As you correctly note, the web hosting provider wants to have control over the actual IP address your host name resolves to, so that they can e.g. move your site from one server to another or implement DNS-based load balancing.

There are basically two ways in which this can be done. For example, assuming that the hostname you want for your site is host.yourdomain.com, you can either:

  1. let your webhost also be the DNS provider for yourdomain.com by telling your registrar to point the NS records for yourdomain.com to the web hosting company's nameservers, or

  2. let your DNS provider return a CNAME record for host.yourdomain.com pointing to e.g. host-yourdomain-com.webhost.com, which your webhost can then resolve to whichever IP address they want.

The second way, using a CNAME record, is slightly less efficient, since it includes an additional indirection step. However, as you note, it's the only practical way to have your web hosting and DNS service be provided by different companies.

As such, I don't fault your webhost for recommending the first method. I do, however, think that they're providing sub-par service if they're insisting on it and refusing to deal with a CNAME record if you prefer to use one.

share|improve this answer
add comment

A Record: DNS record that links a URL to a specific IP address.

CNAME Record: Also referred to as an 'alias' record, CNAME records allow you to maintain site A's URL in the address bar while pointing to an A record for site B.

I'm confused by your question:

Is my impression correct, that most webhosts will happily support a service that begins with a CNAME hosted elsewhere, or is it really more common that webhosts will only provide a service if they control the DNS service too?

I think you are confusing webhost with domain registrar. Please provide some more details about what you are trying to accomplish here:

  • Are you hosting your site at the NEW webhost, or at a different one?
  • Are you trying to make a CNAME record from a current domain name to a NEW domain name?

My understanding is that you have purchased web hosting at Provider A. You will be uploading your website to this provider. The provider needs you to set up your DNS servers (and they probably provide ones for you to use), which requires you to update your NS records (this is because they need an A record for the domain to point to the IP of the box being used). Once that is set up, you could then point a CNAME for a different domain to the A record for the new domain. Is this correct?

share|improve this answer
    
Hi. I've added an illustrative example to the question. –  billpg May 30 '12 at 17:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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