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.


To point your Azion domain to a custom domain, you need to list the CNAMEs you want to configure for the application:

  1. Access Azion Console.
  2. On the upper-left corner of the page, open the Products menu, represented by three horizontal lines, and then select Domain.
  3. Click the domain you want to associate your custom domain to.
  4. In the CNAME field, add the custom domains for the application. For example: yourdomain.com.
  5. Disable the CNAME access only switch.
  6. Click the Save button.

Now your Azion domain is ready to be associated to a custom domain on your DNS provider.

  1. Run the following GET request to retrieve your domain’s ID, replacing [TOKEN VALUE] with your personal token:
Terminal window
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]' \
  1. 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"
}
]
}
  1. Locate the domain you wish to link to the custom domain and copy the domain_id value received in the response.
  2. Run a PATCH request, , replacing [TOKEN VALUE] with your personal token and adding the domain_id as a path, to update the cnames field with the domains you wish to configure:
Terminal window
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"
]
}'
KeyDescription
cnamesAccepts a list of CNAMEs for the domains as values. For example, ["*.yourdomain.com", "*.yourdomain.org"].
  1. You should receive a response with the updated data.

Once 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:

  1. Sign in to your DNS provider.
  2. Choose your domain.
  3. Locate the page where you can modify DNS records for your domain.
  4. Create or edit the www CNAME record of your domain by filling out the information:
NameValueType
wwwxxxxxxxxxx.map.azionedge.netCNAME
  1. 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:

Terminal window
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