Example: Creating a new zone

Primary zones are zones where you enter your DNS records into the Edge DNS system and ​Akamai​ serves those records for you.

1 . Determine the contract and group for the new zone

Users with simple ​Akamai​ configurations may only have one contract and one group. More complex customer configurations involve many different contracts and groups. This API can tell you which contracts and groups are currently relevant to you.

Use the list groups operation to show all the groups that you can access, and the contracts that those groups are assigned to. Pick the contract and group that you want to assign your new Edge DNS zone to. If you only have one group, you don’t have to specify it, but you still have to specify a contract.

2. Create the new zone object
In order to create a primary zone, you only need these options:

  • The name of the zone.
  • The zone type, in this case, primary.
  • The contract ID, and possibly the group ID, which you get from the list groups operation.
  • Whether or not you want to enable DNS SEC sign-and-serve. Ignore this for now.

There are other members that you can use when creating a zone.

This is a simple example that uses these base options:

{
  "zone": "example.com",
  "type": "PRIMARY",
  "signAndServe": false
}

Use that object in the create zone operation. You need to specify the contractId query parameter, and if you have more than one group, you need to also specify a gid query parameter.

You now have a new zone object. If you get the zone’s settings, you’ll see that it is in the NEW state. This means that the zone has been created but it’s not ready yet. In order for ​Akamai​ to serve a zone over DNS, it requires an SOA record and at least one NS record.

3. Add the required records to the zone
If you already know what you want the NS and SOA records to be, you can add multiple record sets to the zone.

You can also have the API fill the records out for you, using good default values. To do this, create a change list on the new zone. That change list is automatically populated with NS and SOA records that work for your account. If you’re happy with the default values, submit the change list.

In either case, the new records are processed, and ​Akamai​ begins serving the zone soon afterwards.