Setting up a Domain Alias¶
Domain aliases are useful if you want to serve images and other static content from a different subdomain (like static.example.com
), or you have versions of your site for different languages (like en.example.com
or es.example.com
). There may be other reasons to use a domain alias, but these are two common ones.
Before we begin, let's be sure that a Domain Alias is really what you want.
- Do you want to add the
www
version of your domain as an alias? You don't need to do anything.www.example.com
is already automatically considered a domain alias forexample.com
. You're set up and ready to go! - Are you looking to duplicate your site for development or staging purposes? Then you do not want to set up a Domain Alias. You want to set up a Development Site.
- Does your site share content over multiple domains and subdomains? For instance, can content from your main
example.com
domain also be accessed viastatic.example.com
orexample.org
? Then you do want a Domain Alias. You are in the right place.
There are two steps to adding a domain alias:
- Adding the alias to the CDN Configuration
- Updating DNS for the alias
Prerequisites¶
- Your main domain (let's call it
example.com
) should already be set up and running with QUIC.cloud. - The alias you wish to add should be a valid domain that already exists, and its DNS should be pointing to the same IP address as your main domain, or to the Server IP listed on your QUIC.cloud Dashboard.
Configure CDN¶
From your Dashboard, click the example.com
domain, navigate to Settings, and add any new aliases to the Domain Alias box, one per line, like so:
static.example.com
example.org
Press Save Settings.
OPTIONAL: Map Both www/non-www¶
The Map Both www/non-www setting in your CDN > CDN Config > QUIC.cloud CDN Settings area allows you to automatically add the www
version of any domain alias as another alias, without having to explicitly declare it in the Domain Aliases box.
Set Map Both www/non-www to ON
, to automatically include www.static.example.com
and www.example.org
as Domain Aliases. If the www
versions of these domains are never used, then you can leave this option OFF
.
Configure DNS¶
If you are using QUIC.cloud DNS for your domain, skip down to the QUIC.cloud DNS section. If you are not using QUIC.cloud for your domain's DNS, then you are using the CNAME method.
CNAME Method¶
For a Subdomain (static.example.com)¶
Visit your DNS provider and find the CNAME
record for static.example.com
. If a CNAME
record doesn't exist, create one, and set the Name to static.example.com
. (Use the actual subdomain you want to use for your domain alias.) Otherwise, edit the existing record. Set the Value of the new or existing record to c12345.tier1.quicns.com
. (Use the actual assigned value for your account. You will find it on your QUIC.cloud Dashboard under CDN > CDN Config > Your assigned CNAME is.)
For a Root Domain (example.org)¶
Since example.org
is a root (or apex) domain, then you will need to have an ALIAS
, ANAME
, or flattened CNAME
DNS record to use the CNAME method. Which of these records you need depends on your DNS provider, and how they handle root (or apex) domains.
If there is not already an existing ALIAS
, ANAME
, or flattened CNAME
record for example.org
, create one and set Name to example.org
. (Use the actual TLD domain you want to use for your domain alias.) Otherwise, edit the existing record.
Set the Value of the new or existing record to c12345.tier1.quicns.com
. (Use the actual assigned value for your account. You will find it on your QUIC.cloud Dashboard under CDN > CDN Config > Your assigned CNAME is.)
QUIC.cloud DNS¶
For a Subdomain (static.example.com)¶
If you are using QUIC.cloud DNS, you can set up the DNS for static.example.com
from the DNS Zones link in your QUIC.cloud Dashboard.
Click example.com
to enter the DNS Zone for that domain.
Find the A
record for static.example.com
. It should already exist and be pointing to your server IP. If it does, then you are done.
If an A
record doesn't exist, click the Add a New Record button and fill in the details like so:
- Type:
A
- Host:
static
(Use the actual subdomain you want to use for your domain alias) - IPv4 address:
192.0.2.0
(Use your actual Server IP ) - TTL:
Auto
(Or another value; this is personal preference)
Click the Add Record button.
For a New Top-Level Root Domain (example.org)¶
If you are using QUIC.cloud DNS, you can set up the DNS for example.org
from the DNS Zones link in your QUIC.cloud Dashboard.
Click the Add New Domain to DNS Zones link, located at the bottom of your list of domains. Enter example.org
and press the Add Domain key. Your domain's DNS records will be imported into QUIC.cloud, and you'll be prompted to update your NS servers at the domain's registrar. See Switching to QUIC.cloud DNS for more information about this process.
Verification¶
Once the DNS changes are completed and have propagated, the CDN will automatically attempt to verify your new setup. Click CDN in the navigation menu to check the current verification status. When verification is complete, all traffic for your main domain and aliases will be routed through QUIC.cloud and your Domain Alias setup is complete!