Create secondary zone
curl --request POST \
--url https://api.gcore.com/dns/v2/secondary-zones \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"meta": {},
"poll_interval": 123,
"primary_server": {
"address": "<string>",
"meta": {},
"priority": 123
},
"tsig_algorithm": "<string>",
"tsig_key_name": "<string>",
"tsig_secret": "<string>",
"use_tls": true,
"zone_name": "<string>"
}
'import requests
url = "https://api.gcore.com/dns/v2/secondary-zones"
payload = {
"meta": {},
"poll_interval": 123,
"primary_server": {
"address": "<string>",
"meta": {},
"priority": 123
},
"tsig_algorithm": "<string>",
"tsig_key_name": "<string>",
"tsig_secret": "<string>",
"use_tls": True,
"zone_name": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
meta: {},
poll_interval: 123,
primary_server: {address: '<string>', meta: {}, priority: 123},
tsig_algorithm: '<string>',
tsig_key_name: '<string>',
tsig_secret: '<string>',
use_tls: true,
zone_name: '<string>'
})
};
fetch('https://api.gcore.com/dns/v2/secondary-zones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/dns/v2/secondary-zones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'meta' => [
],
'poll_interval' => 123,
'primary_server' => [
'address' => '<string>',
'meta' => [
],
'priority' => 123
],
'tsig_algorithm' => '<string>',
'tsig_key_name' => '<string>',
'tsig_secret' => '<string>',
'use_tls' => true,
'zone_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/dns/v2/secondary-zones"
payload := strings.NewReader("{\n \"meta\": {},\n \"poll_interval\": 123,\n \"primary_server\": {\n \"address\": \"<string>\",\n \"meta\": {},\n \"priority\": 123\n },\n \"tsig_algorithm\": \"<string>\",\n \"tsig_key_name\": \"<string>\",\n \"tsig_secret\": \"<string>\",\n \"use_tls\": true,\n \"zone_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/dns/v2/secondary-zones")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"meta\": {},\n \"poll_interval\": 123,\n \"primary_server\": {\n \"address\": \"<string>\",\n \"meta\": {},\n \"priority\": 123\n },\n \"tsig_algorithm\": \"<string>\",\n \"tsig_key_name\": \"<string>\",\n \"tsig_secret\": \"<string>\",\n \"use_tls\": true,\n \"zone_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/dns/v2/secondary-zones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"meta\": {},\n \"poll_interval\": 123,\n \"primary_server\": {\n \"address\": \"<string>\",\n \"meta\": {},\n \"priority\": 123\n },\n \"tsig_algorithm\": \"<string>\",\n \"tsig_key_name\": \"<string>\",\n \"tsig_secret\": \"<string>\",\n \"use_tls\": true,\n \"zone_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"client_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"id": 123,
"last_serial": 123,
"last_transfer_at": "2023-11-07T05:31:56Z",
"meta": {},
"poll_interval": 123,
"transfer_mode": "<string>",
"tsig_algorithm": "<string>",
"tsig_key_name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"use_tls": true,
"zone_name": "<string>"
}{
"code": "<string>",
"error": "<string>",
"message": "<string>"
}{
"code": "<string>",
"error": "<string>",
"message": "<string>"
}{
"code": "<string>",
"error": "<string>",
"message": "<string>"
}SecondaryZones
Create secondary zone
Create a secondary zone. Optionally include primary_server to create
the first primary server in the same request.
POST
/
dns
/
v2
/
secondary-zones
Create secondary zone
curl --request POST \
--url https://api.gcore.com/dns/v2/secondary-zones \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"meta": {},
"poll_interval": 123,
"primary_server": {
"address": "<string>",
"meta": {},
"priority": 123
},
"tsig_algorithm": "<string>",
"tsig_key_name": "<string>",
"tsig_secret": "<string>",
"use_tls": true,
"zone_name": "<string>"
}
'import requests
url = "https://api.gcore.com/dns/v2/secondary-zones"
payload = {
"meta": {},
"poll_interval": 123,
"primary_server": {
"address": "<string>",
"meta": {},
"priority": 123
},
"tsig_algorithm": "<string>",
"tsig_key_name": "<string>",
"tsig_secret": "<string>",
"use_tls": True,
"zone_name": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
meta: {},
poll_interval: 123,
primary_server: {address: '<string>', meta: {}, priority: 123},
tsig_algorithm: '<string>',
tsig_key_name: '<string>',
tsig_secret: '<string>',
use_tls: true,
zone_name: '<string>'
})
};
fetch('https://api.gcore.com/dns/v2/secondary-zones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/dns/v2/secondary-zones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'meta' => [
],
'poll_interval' => 123,
'primary_server' => [
'address' => '<string>',
'meta' => [
],
'priority' => 123
],
'tsig_algorithm' => '<string>',
'tsig_key_name' => '<string>',
'tsig_secret' => '<string>',
'use_tls' => true,
'zone_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/dns/v2/secondary-zones"
payload := strings.NewReader("{\n \"meta\": {},\n \"poll_interval\": 123,\n \"primary_server\": {\n \"address\": \"<string>\",\n \"meta\": {},\n \"priority\": 123\n },\n \"tsig_algorithm\": \"<string>\",\n \"tsig_key_name\": \"<string>\",\n \"tsig_secret\": \"<string>\",\n \"use_tls\": true,\n \"zone_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/dns/v2/secondary-zones")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"meta\": {},\n \"poll_interval\": 123,\n \"primary_server\": {\n \"address\": \"<string>\",\n \"meta\": {},\n \"priority\": 123\n },\n \"tsig_algorithm\": \"<string>\",\n \"tsig_key_name\": \"<string>\",\n \"tsig_secret\": \"<string>\",\n \"use_tls\": true,\n \"zone_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/dns/v2/secondary-zones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"meta\": {},\n \"poll_interval\": 123,\n \"primary_server\": {\n \"address\": \"<string>\",\n \"meta\": {},\n \"priority\": 123\n },\n \"tsig_algorithm\": \"<string>\",\n \"tsig_key_name\": \"<string>\",\n \"tsig_secret\": \"<string>\",\n \"use_tls\": true,\n \"zone_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"client_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"id": 123,
"last_serial": 123,
"last_transfer_at": "2023-11-07T05:31:56Z",
"meta": {},
"poll_interval": 123,
"transfer_mode": "<string>",
"tsig_algorithm": "<string>",
"tsig_key_name": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"use_tls": true,
"zone_name": "<string>"
}{
"code": "<string>",
"error": "<string>",
"message": "<string>"
}{
"code": "<string>",
"error": "<string>",
"message": "<string>"
}{
"code": "<string>",
"error": "<string>",
"message": "<string>"
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Body
application/json
Response
SecondaryZoneResponse
Show child attributes
Show child attributes
Was this page helpful?
⌘I