This is a series of articles dedicated to demonstrating how to get acquainted with Openprovider DNS Zones API methods.
This is a first article in a series in which we are going to cover DNS zone creation. To get more information about our API in general, please use our documentation portal as your reference.
While being a domain registrar Openprovider also provides DNS hosting for which we have an extensive API.
Zones represent the DNS zone for a domain. Each domain usually have a zone, however zones may also exist without a domain. Zones have at least 1 (but oftentimes more) records. All zones represent a combination of system records, which are records that are created automatically by us, such as SOA and NS records, as well as custom records, which are records created by users.
Once you have an Openprovider account you can use the Zones API methods which will allow you to list records for a zone, as well as add, edit, and remove zone records.
However, first things first. Let's focus on creating a zone as our starting point.
POST {base_url}/dns/zones
REQUEST VALUES↓
Name | Type | Description |
domain | string | Required. name of a zone (domain name) |
type | string | Required. master or slave |
master_ip | string | Optional. required for type = slave |
records | array of data | Required for master zones |
template_name | string | Optional. |
is_spamexpert_enabled | boolean | Optional. Enable SE subscription for a zone |
secured | boolean | Optional. Enable DNSSEC |
REQUEST EXAMPLE↓
curl -X POST \
'https://api.openprovider.eu/v1beta/dns/zones' \
-H 'Authorization: ,Bearer 2831a37fb8*******90b5aac822' \
-H 'Content-Type: application/json' \
-d '{
"domain": {
"extension": "nl",
"name": "op-demozone"
},
"type": "master",
"records": [
{
"name": "acmelab0",
"ttl": "900",
"type": "TXT",
"value": "test value 0"
},
{
"name": "acmelab1",
"ttl": "900",
"type": "TXT",
"value": "test value 1"
}
]
}'
RESPONSE EXAMPLE↓
{
"code": 0,
"desc": "",
"data": {
"success": true
}
}
Once you have decided on the records that your zone should store(or the absence of the latter), you can use our API endpoint, api.openprovider.eu
, to send a request.
The 0 code that we received indicates that the zone has been successfully created.
Now let's try to retrieve it from the API to make sure of that and change some of its records.