Add a custom domain to an application
List a hostname you own on a domain that serves an application, point its DNS record at the Azion address, and close that address, from Console or the API.
You can serve an application on a domain you own from Azion Console or the API. A domain connects hostnames to an application, and lists those hostnames in its CNAME field.
A custom domain, on this page, is a hostname of a domain you own, such as www.example.com. Every domain already answers on its Azion address, a hostname that Azion generates in the form xxxxxxxxxx.map.azionedge.net. Serving your own hostname takes two changes: the domain lists the hostname, and a DNS record points the hostname at the Azion address.
Prerequisites
Console
- An application for the domain to serve.
- A domain you own, and access to its DNS records at your DNS provider or in Edge DNS.
- Access to Azion Console. For more information, refer to How to access Azion Console.
List the hostnames on a domain
Console
To list a hostname on a domain in Azion Console:
Access Azion Console > Domains.
Select + Domain, or select an existing domain to edit it.
Enter a name. The name identifies the entry on the account and is not a hostname.
In Environment Type, select Global Edge Network for production or Staging Network for a test environment.
In Applications, select your application. In Firewall, select your firewall.
In CNAME, list the hostnames you serve, one per line.
Leave CNAME access only off to keep the xxxxxxxxxx.map.azionedge.net address reachable, or turn it on to answer only the hostnames you listed.
In Digital Certificate, select Azion SAN or a certificate of your own.
Select Save.
Point the domain at the Azion address
Requests reach the application once DNS resolves your hostname to the Azion address of the domain. The API returns that address in domain_name.
At your DNS provider, create a record for the hostname with these values:
| Field | Value |
|---|---|
| Name | Your hostname, such as www.example.com |
| Type | CNAME |
| Value | The Azion address of the domain, such as xxxxxxxxxx.map.azionedge.net |
When Edge DNS holds the zone of your domain, create the record there instead.
Once resolvers pick up the record and the domain change propagates, requests to your hostname reach the application the domain serves. A change takes several minutes to reach all of Azion’s distributed infrastructure, and requests can receive the old or the new configuration meanwhile. Repeat a request until the answers agree.
HTTPS on your hostname needs a server certificate that covers it, and the default Azion SAN certificate does not cover a hostname of your own. To get a certificate for your domain, refer to Request a Let’s Encrypt certificate or Upload a digital certificate.
Close the Azion address
With CNAME access only off, the domain also answers on its Azion address. Turn it on when the domain must answer only on your hostnames. Do it after your hostnames answer as expected, because a closed Azion address no longer serves your application.
To close the Azion address in Azion Console:
Access Azion Console > Domains > the domain that lists your hostname.
Select Save.
With the API, cname_access_only set to true makes the same choice when you create the domain.