How to migrate nameservers to Azion

Azion allows you to host and manage DNS zones and records by redirecting the DNS resolution of your domain provider to Azion’s authoritative nameservers (NS) through Edge DNS.


To create a DNS zone for a domain entry yourdomain.org:

  1. Access Azion Console.
  2. On the upper-left corner of the page, click the three horizontal lines to open the Products menu and select Edge DNS.
  3. Click the Add Zone button.
  4. Give your zone an easy-to-remember name.
  5. Indicate the FQDN as recorded in the DNS. Example: yourdomain.org.
  6. Click the Save button.

You’ll be redirected to your list of zones. To get the Azion nameservers:

  1. Click the zone you created.
  2. In the zone screen, under Nameservers, you’ll see Azion’s nameservers:
  • ns1.aziondns.net
  • ns2.aziondns.com
  • ns3.aziondns.org
  1. Keep these values in hand for when you redirect the authoritative nameservers of your domain.
  1. Run the following POST request in your terminal, replacing [TOKEN VALUE] with your personal token and adding your domain address in the domain field:
Terminal window
curl --location 'https://api.azionapi.net/intelligent_dns' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Accept: application/json; version=3' \
--header 'Content-Type: application/json' \
--data '{
"name": "yourdomain.com",
"domain": "yourdomain.com",
"is_active": true
}'
KeyDescription
nameSets the string in the value as a name of the zone entry with Azion.
domainSets the apex domain.
is_activeWhen true, activates the zone.
  1. You’ll receive a response similar to this:
{
"results": [
{
"nx_ttl": 3600,
"domain": "yourdomain.com",
"retry": 7200,
"name": "yourdomain.com",
"nameservers": [
"ns1.aziondns.net",
"ns2.aziondns.com",
"ns3.aziondns.org"
],
"soa_ttl": 3600,
"is_active": true,
"refresh": 43200,
"expiry": 1209600,
"id": 3211
}
]
}
  1. Copy the values inside the nameservers field. These values will be used to redirect the authoritative nameservers of your domain.
  2. Copy the id value for when you associate an application to your zone.

Step 2: Redirect authoritative nameservers

Section titled Step 2: Redirect authoritative nameservers

The next step is to redirect your domain’s authoritative nameservers, and for this, you’ll need to access your domain provider and modify your NS records. Here are some of the most popular domain providers and how they handle DNS nameserver changes:

Azion recommends that you add all of the three available Azion nameservers for additional reliability:

  • ns1.aziondns.net
  • ns2.aziondns.com
  • ns3.aziondns.org

Once your nameserver records have been updated to Azion’s addresses, you’ll be able to create records directly from Azion. See the next section for an example on how to do that.


Step 3: Create edge application record in DNS zone

Section titled Step 3: Create edge application record in DNS zone

After you’ve successfully migrated your DNS zone to Azion, you won’t need to access your domain provider to create new records, since you can do that directly with Azion. This means you can launch your application with it’s custom domain and easily create new applications and records as needed.

To associate a new edge application to your domain, you’ll need to create a new CNAME record in your zone and associate it to an edge application.

To customize the domain of your edge application under your new zone, you need to associate the CNAME of your edge application to a new record. Retrieve the custom domains listed for the application by following the steps:

  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 that should be under your DNS zone. If you already added a custom domain, copy those values and keep them in hand.

Now you’ll need to navigate to the Edge DNS area to add a record for your edge application’s CNAMEs:

  1. On the upper-left corner of the page, open the Products menu, represented by three horizontal lines, and then select Edge DNS.
  2. Select the DNS zone.
  3. Navigate to the Records tab.
  4. Under Name, create a hostname or subdomain. For example: *.
  5. Under Type, select CNAME - Canonical name.
  6. Under Value, enter the Azion domain address in FQDN format. Example: xxxxxxxxxx.map.azionedge.net.
  7. Set the TTL and Policy as desired.
  8. Click the Save button.

Repeat the process described above for every CNAME listed for your application. Wait a couple of minutes for the changes to propagate. You can run the DIG command in your terminal to check whether your domain points to the Azion address.

  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' \
--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. If you have no CNAMEs listed, run a PATCH request, 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", "blog.yourdomain.com"].
  1. Run a new GET request to retrieve the hosted_zone_id, which indicates the DNS zone you created:
{
...
"results": [
{
"domain": "yourdomain.com - zone",
"is_active": true,
"name": "yourdomain.com",
"id": <hosted_zone_id>
}
]
}
  1. Run the following POST request in your terminal, replacing [TOKEN VALUE] with your personal token, hosted_zone_id with the value from the previous response and the answers list with the Azion domain address as a string:
Terminal window
curl --location 'https://api.azionapi.net/intelligent_dns/<hosted_zone_id>/records' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Accept: application/json; version=3' \
--data-raw '{
"record_type": "CNAME",
"entry": "www",
"answers_list": [
"xxxxxxxxxx.map.azionedge.net"
],
"description": "www record",
"ttl": 20
}'
KeyDescription
record_typeThe type of record being created. See a full list of accepted record types in the Edge DNS documentation.
entrySets the value of the entry, appending it to the apex domain from the zone to generate the record. For example, the value www will represent a record for www.yourdomain.com. Accepts the wildcard (*) notation.
answers_listAccepts a list of CNAMEs for the domains as values. In the example described above, the CNAME is the Azion address.
descriptionSets the string as a record description.
ttlAccepts a list of CNAMEs for the domains as values. For example, ["www.yourdomain.com", "blog.yourdomain.com"].
  1. You’ll receive a reponse confirming that the new record was created:
{
"results": {
"answers_list": [
"xxxxxxxxxx.map.azionedge.net"
],
"zone_id": <hosted_zone_id>,
"record_type": "CNAME",
"ttl": 20,
"policy": "simple",
"entry": "www",
"id": <record_id>,
"description": "www record"
}
}
  1. Wait a couple of minutes for the changes to propagate. You can run the DIG command in your terminal to check whether your domain points to the Azion address.

Contributors