Add, edit, or delete a record
Add, change, or delete a record in an Edge DNS zone from Azion Console, the Azion CLI, or the API, and see when Azion's nameservers answer it.
You can add, edit, or delete a record in an Edge DNS zone from Azion Console, the Azion CLI, or the Azion API. Each record tells Azion’s nameservers which values to return for one name of the zone. To create the zone itself, refer to Create, edit, or delete a zone.
Choose an interface. Each section below then shows the steps for that interface only.
Prerequisites
- A zone in Edge DNS for your domain. To create one, refer to Create, edit, or delete a zone.
- The Edit Edge DNS permission, which requires View Edge DNS. Refer to Teams permissions.
- Access to Azion Console. To sign in, refer to Access Azion Console.
Add a record
The example adds an A record that answers 192.0.2.1 for www.example.com. Replace the name, the type, and the value with your own. The value format of each type is on Record types.
To add the record with the Azion CLI, replace <zone-id> with the ID of your zone. Enter the name relative to the zone, without the domain:
The command prints the ID of the record:
The zone holds the record. To give a record several values, repeat --rdata or pass the values as a comma-separated list.
The API refuses a record that conflicts with the zone, such as a second simple record of the same name and type, and the record is not saved. For each refusal and its code, refer to Zones and records.
Save a record before anything queries its name. A name that nobody queried before you saved its record answers within seconds. A name queried earlier is answered NXDOMAIN for up to one hour, the SOA minimum. To fix it, refer to A new record returns NXDOMAIN.
Edit a record
You change a record in place, with no need to delete and add it again. The example lowers the TTL of www to 300 seconds, which shortens how long resolvers keep the old value before a planned change. For that practice, refer to Lower the TTL a few days before a planned change.
To edit the record with the Azion CLI, pass only the flags you change. Replace <record-id> with the ID that the create printed:
The command confirms the update:
To change what the record answers, pass the value to --rdata instead. To check the result, list the records of the zone:
The output prints one row per record, with its ID:
The TTL column of the record reads 300.
A change to an existing record can take a few minutes to reach every nameserver. After that, each resolver keeps the old value until its TTL runs out. If a query still returns the old value, refer to A changed record still returns the old value.
Delete a record
Deleting a record removes it from the zone, and it cannot be reversed. For a weighted record, first set its weight to 0, as Set a weight of 0 before you delete a weighted record explains.
To delete the record with the Azion CLI, replace <zone-id> and <record-id> with the IDs of the zone and the record:
The command confirms the delete:
The record is deleted, and azion list dns-record --zone-id <zone-id> no longer lists it.
Resolvers that cached an answer from the record keep it until the record’s TTL runs out.