How to point a domain to Azion
If you already own a domain, you can associate your domain CNAME entries to your Azion domain address through Domains, effectively directing access to your edge application.
Before you point your traffic to Azion, you can test your custom domain on the edge locally by staging your application through the hosts file
Step 1: Verify custom domain
Section titled Step 1: Verify custom domainVia RTM
Section titled Via RTMTo point your Azion domain to a custom domain, you need to list the CNAMEs you want to configure for the application:
- Access RTM.
- On the upper-left corner of the page, open the Products menu, represented by three horizontal lines, and then select Domain.
- Click the domain you want to associate your custom domain to.
- In the CNAME field, add the custom domains for the application. For example:
yourdomain.com
. - Disable the CNAME access only switch.
- Click the Save button.
Now your Azion domain is ready to be associated to a custom domain on your DNS provider.
Via API
Section titled Via API- Run the following
GET
request to retrieve your domain’s ID, replacing[TOKEN VALUE]
with your personal token:
curl --location 'https://api.azionapi.net/domains?order_by=name&sort=asc&page=1&page_size=10' \--header 'Accept: application/json; version=3' \--header 'Authorization: Token [TOKEN VALUE]' \
- You’ll receive a response similar to this:
{ ... "results": [ { "id": <domain_id>, "name": "yourdomain.com CA1 DC-yourdomain.com", "cnames": [], "cname_access_only": true, "digital_certificate_id": <digital_certificate_id>, "edge_application_id": <edge_application_id>, "is_active": true, "domain_name": "xxxxxxxxxx.map.azionedge.net" } ]}
- Locate the domain you wish to link to the custom domain and copy the
domain_id
value received in the response. - Run a
PATCH
request, , replacing[TOKEN VALUE]
with your personal token and adding thedomain_id
as a path, to update thecnames
field with the domains you wish to configure:
curl --location --request PATCH 'https://api.azionapi.net/domains/<domain_id>' \--header 'Accept: application/json; version=3' \--header 'Authorization: Token [TOKEN VALUE]' \--header 'Content-Type: application/json' \--data '{ "cnames": [ "yourdomain.com", "*.yourdomain.com" ]}'
Key | Description |
---|---|
cnames | Accepts a list of CNAMEs for the domains as values. For example, ["*.yourdomain.com", "*.yourdomain.org"] . |
- You should receive a response with the updated data.
Step 2: Modify domain records
Section titled Step 2: Modify domain recordsOnce you have a domain, you need to access your DNS provider and locate the records management area. There, you can modify every entry associated with your domain. The entry you need to associate your Azion domain to is a CNAME record.
At your DNS provider, you can add or modify a www
CNAME record and associate it to your edge application. See the documentation on how to edit domain records of some of the most popular DNS providers below:
To configure your DNS records:
- Sign in to your DNS provider.
- Choose your domain.
- Locate the page where you can modify DNS records for your domain.
- Create or edit the
www
CNAME record of your domain by filling out the information:
Name | Value | Type |
---|---|---|
www | xxxxxxxxxx.map.azionedge.net | CNAME |
- Don’t forget to save your settings.
Note that there might be a delay in propagation time when you access your application. If that’s the case, you can run the dig command in your terminal to check the DNS records of your edge node. For example:
dig +short yourdomain.org @200.0.0.0
Once the changes have propagated, you’ll be able to access your edge application through your custom domain.
Contributors