Skip to main content
All CollectionsDNS Hosting
Forwarding to Cloud Providers
Forwarding to Cloud Providers

This article contains solutions for connecting a domain name to cloud providers via 301 redirects, root CNAME forwarding and more.

Garrett Saundry avatar
Written by Garrett Saundry
Updated over a week ago

The use of cloud providers for services such as web hosting continues to grow in popularity. These providers offer cheap, reliable and scalable services which cater to a broad section of Internet users. Examples of cloud providers include: Blogger, Amazon Web Services, Microsoft Azure, Cloudflare, Google, Rackspace, Wix, Weebly, Photobucket, and Hubspot.

One aspect of these cloud providers that can prove challenging is connecting a custom domain to them. The primary reason for this is that since these providers reside in the cloud, they have no fixed IP address to connect a domain name to. Those that are familiar with DNS will know that the fundamental role of DNS is to connect a domain name to an IP address (similar to how an electronic address book connects a person's name with their phone number). In the case of cloud providers, there is no 'phone number' to connect to, but rather just another name.

Within DNS, connecting one domain name to another domain name is easier said than done, since doing so breaks a few rules about how DNS is supposed to operate. With this being said, and with cloud provider's growing popularity, the DNS industry is adapting. Below we will cover how to connect your Webnames domain name to a cloud provider.

Forwarding can be achieved through three different means:

FORWARD WWW VIA 301 REDIRECT (& CNAME THE ROOT)

This method of forwarding a domain name to a cloud provider is very common and will serve to be more flexible than the simple forwarding of the Root domain via CNAME. This solution works well, and thus is a favorite option of cloud providers.

This solution has two steps:

  1. Forward your Root to the www (e.g. create a 301 REDIRECT to forward yourdomainname.ca -> www.yourdomainname.ca)

  2. Forward your www to your Cloud Provider (e.g. create a CNAME for www.yourdomainname.ca -> yourcloudprovider.ca)

By utilizing a 301 Redirect on the root of your domain name instead of a CNAME, the issue of routing ALL traffic (including email) towards the destination of the CNAME (i.e. your cloud provider) is avoided.

SETTING UP A 301 REDIRECT AND CNAME

To create a 301 Redirect for the root of your domain and a CNAME for the www to your cloud hosting provider, within our Advanced DNS or Premium DNS services follow the steps below.

  • Step 1 Forward your Root to the www . Ensure that 'Forward root only (not www) is checked.

  • Step 2 Forward your www to your Cloud Provider (e.g. create a CNAME for www.yourdomainname.ca -> yourcloudprovider.ca)

CNAME THE ROOT

One of the most common methods of forwarding a domain name is through a CNAME. Short for Canonical Name, a CNAME record defines one domain name as an alias of another.

yourdomainname.ca -> hosting.yourcloudprovider.ca

This would be a simplified example of forwarding one domain name to another. This simplification comes with some notable constraints, namely that it results in the forwarding of everything to do with yourdomainname.ca to yourcloudprovier.ca INCLUDING EMAIL. Often times your cloud hosting provider is not your email provider, and in such case this simple setup will not be adequate. This inadequacy is also partially why a cloud provider may instead have instructions or limitations that state only the www can be forwarded - and not the root.

SETTING UP A ROOT CNAME

To create a CNAME Record for the root of your domain within our Advanced DNS or Premium DNS services follow the step below. Because of issues regarding the routing of mail and other traffic, Webnames does not recommend this option ever be used. If your cloud provider is making this recommendation regardless, please contact us to see how an alternative setup can be implemented.

  • Step 1 Forward your root domain to your Cloud Provider (e.g. create a CNAME for yourdomainname.ca -> yourcloudprovider.ca)

ALIAS RECORD

The above two solutions have developed over time, and are born out of a need to forward part of a domain name's intended traffic (i.e. everything BUT email) to another domain name. This is done by creating a redirect between the www of your domain and your cloud provider. The root of your domain is not redirected to your cloud provider directly, but rather it is forward to your www. This is not intuitive, and not very direct. To address this convulsion, a new record type has been developed, and this is called the ALIAS Record (not to be confused with the casual term 'alias', which is often used to describe a CNAME).

NOTE: ALIAS Records are available as part of our Premium DNS service.

ALIAS Records have the function of both a CNAME and an A record. In more precise words, an ALIAS Record is defined similarly to a CNAME, but when queried via DNS the ALIAS Record returns the IP address of the CNAME.

The ALIAS Record allows any domain name or subdomain to be redirected directly to the then current IP address of your cloud provider.

The catch: Your cloud provider must be configured to know what to do with requests for the domains and subdomains you direct to it. It is not possible to simply direct a domain name to a provider and have the desired content appear. At the cloud provider, services must be configured to know what content to serve upon each request.

Because creating a CNAME for the www record and forwarding that (see CNAME the WWW, above), most cloud providers are configured to serve content upon request of the www ONLY. Again the reasoning for this has to do with working within the available solutions that have historically been available, as opposed to conscious decisions to limit functionality.

The ALIAS Record provides the specific functionality and exact preciseness that is required to elegantly connect an external domain name to a cloud hosting provider.

SETTING UP ALIAS RECORDS

To create an ALIAS Record for both the root of your domain and the www to your cloud hosting provider, within our Premium DNS services follow the steps below.

  • Step 1 Direct your root domain to your Cloud Provider (e.g. create an ALIAS RECORD for .yourdomainname.ca -> yourcloudprovider.ca)

  • Step 2 Direct your www domain to your Cloud Provider (e.g. create an ALIAS RECORD for www.yourdomainname.ca -> yourcloudprovider.ca)

Note that in the case of each ALIAS Record which you create, your cloud hosting provider must be configured receive requests for each name as well.

Did this answer your question?