Update RRset
curl --request PUT \
--url https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"resource_records": [
{
"content": [
100,
1,
5061,
"example.com"
],
"enabled": true,
"meta": {
"asn": [
17544,
17812
],
"continents": [
"europe",
"asia"
],
"countries": [
"us",
"gb",
"lu"
],
"ip": [
"192.168.15.150/25",
"2003:de:2016::/48"
],
"weight": 30
}
}
],
"meta": {},
"pickers": [
{
"limit": 123,
"strict": true
}
],
"ttl": 123
}
'import requests
url = "https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType}"
payload = {
"resource_records": [
{
"content": [100, 1, 5061, "example.com"],
"enabled": True,
"meta": {
"asn": [17544, 17812],
"continents": ["europe", "asia"],
"countries": ["us", "gb", "lu"],
"ip": ["192.168.15.150/25", "2003:de:2016::/48"],
"weight": 30
}
}
],
"meta": {},
"pickers": [
{
"limit": 123,
"strict": True
}
],
"ttl": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resource_records: [
{
content: [100, 1, 5061, 'example.com'],
enabled: true,
meta: {
asn: [17544, 17812],
continents: ['europe', 'asia'],
countries: ['us', 'gb', 'lu'],
ip: ['192.168.15.150/25', '2003:de:2016::/48'],
weight: 30
}
}
],
meta: {},
pickers: [{limit: 123, strict: true}],
ttl: 123
})
};
fetch('https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType}', 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/zones/{zoneName}/{rrsetName}/{rrsetType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'resource_records' => [
[
'content' => [
100,
1,
5061,
'example.com'
],
'enabled' => true,
'meta' => [
'asn' => [
17544,
17812
],
'continents' => [
'europe',
'asia'
],
'countries' => [
'us',
'gb',
'lu'
],
'ip' => [
'192.168.15.150/25',
'2003:de:2016::/48'
],
'weight' => 30
]
]
],
'meta' => [
],
'pickers' => [
[
'limit' => 123,
'strict' => true
]
],
'ttl' => 123
]),
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/zones/{zoneName}/{rrsetName}/{rrsetType}"
payload := strings.NewReader("{\n \"resource_records\": [\n {\n \"content\": [\n 100,\n 1,\n 5061,\n \"example.com\"\n ],\n \"enabled\": true,\n \"meta\": {\n \"asn\": [\n 17544,\n 17812\n ],\n \"continents\": [\n \"europe\",\n \"asia\"\n ],\n \"countries\": [\n \"us\",\n \"gb\",\n \"lu\"\n ],\n \"ip\": [\n \"192.168.15.150/25\",\n \"2003:de:2016::/48\"\n ],\n \"weight\": 30\n }\n }\n ],\n \"meta\": {},\n \"pickers\": [\n {\n \"limit\": 123,\n \"strict\": true\n }\n ],\n \"ttl\": 123\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resource_records\": [\n {\n \"content\": [\n 100,\n 1,\n 5061,\n \"example.com\"\n ],\n \"enabled\": true,\n \"meta\": {\n \"asn\": [\n 17544,\n 17812\n ],\n \"continents\": [\n \"europe\",\n \"asia\"\n ],\n \"countries\": [\n \"us\",\n \"gb\",\n \"lu\"\n ],\n \"ip\": [\n \"192.168.15.150/25\",\n \"2003:de:2016::/48\"\n ],\n \"weight\": 30\n }\n }\n ],\n \"meta\": {},\n \"pickers\": [\n {\n \"limit\": 123,\n \"strict\": true\n }\n ],\n \"ttl\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_records\": [\n {\n \"content\": [\n 100,\n 1,\n 5061,\n \"example.com\"\n ],\n \"enabled\": true,\n \"meta\": {\n \"asn\": [\n 17544,\n 17812\n ],\n \"continents\": [\n \"europe\",\n \"asia\"\n ],\n \"countries\": [\n \"us\",\n \"gb\",\n \"lu\"\n ],\n \"ip\": [\n \"192.168.15.150/25\",\n \"2003:de:2016::/48\"\n ],\n \"weight\": 30\n }\n }\n ],\n \"meta\": {},\n \"pickers\": [\n {\n \"limit\": 123,\n \"strict\": true\n }\n ],\n \"ttl\": 123\n}"
response = http.request(request)
puts response.read_body{
"name": "sub.example.com",
"resource_records": [
{
"content": [
100,
1,
5061,
"example.com"
],
"enabled": true,
"id": 42,
"meta": {
"continents": [
"europe",
"asia"
],
"countries": [
"us",
"gb",
"lu"
],
"ip": [
"192.168.15.150/25",
"2003:de:2016::/48"
]
}
}
],
"filter_set_id": 123,
"meta": {},
"pickers": [
{
"limit": 123,
"strict": true
}
],
"ttl": 123,
"updated_at": "2023-11-07T05:31:56Z",
"warning": "<string>",
"warnings": [
{
"key": "<string>",
"message": "<string>"
}
]
}This response has no body data.RRsets
Update RRset
Create/update RRset.
PUT
/
dns
/
v2
/
zones
/
{zoneName}
/
{rrsetName}
/
{rrsetType}
Update RRset
curl --request PUT \
--url https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"resource_records": [
{
"content": [
100,
1,
5061,
"example.com"
],
"enabled": true,
"meta": {
"asn": [
17544,
17812
],
"continents": [
"europe",
"asia"
],
"countries": [
"us",
"gb",
"lu"
],
"ip": [
"192.168.15.150/25",
"2003:de:2016::/48"
],
"weight": 30
}
}
],
"meta": {},
"pickers": [
{
"limit": 123,
"strict": true
}
],
"ttl": 123
}
'import requests
url = "https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType}"
payload = {
"resource_records": [
{
"content": [100, 1, 5061, "example.com"],
"enabled": True,
"meta": {
"asn": [17544, 17812],
"continents": ["europe", "asia"],
"countries": ["us", "gb", "lu"],
"ip": ["192.168.15.150/25", "2003:de:2016::/48"],
"weight": 30
}
}
],
"meta": {},
"pickers": [
{
"limit": 123,
"strict": True
}
],
"ttl": 123
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resource_records: [
{
content: [100, 1, 5061, 'example.com'],
enabled: true,
meta: {
asn: [17544, 17812],
continents: ['europe', 'asia'],
countries: ['us', 'gb', 'lu'],
ip: ['192.168.15.150/25', '2003:de:2016::/48'],
weight: 30
}
}
],
meta: {},
pickers: [{limit: 123, strict: true}],
ttl: 123
})
};
fetch('https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType}', 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/zones/{zoneName}/{rrsetName}/{rrsetType}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'resource_records' => [
[
'content' => [
100,
1,
5061,
'example.com'
],
'enabled' => true,
'meta' => [
'asn' => [
17544,
17812
],
'continents' => [
'europe',
'asia'
],
'countries' => [
'us',
'gb',
'lu'
],
'ip' => [
'192.168.15.150/25',
'2003:de:2016::/48'
],
'weight' => 30
]
]
],
'meta' => [
],
'pickers' => [
[
'limit' => 123,
'strict' => true
]
],
'ttl' => 123
]),
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/zones/{zoneName}/{rrsetName}/{rrsetType}"
payload := strings.NewReader("{\n \"resource_records\": [\n {\n \"content\": [\n 100,\n 1,\n 5061,\n \"example.com\"\n ],\n \"enabled\": true,\n \"meta\": {\n \"asn\": [\n 17544,\n 17812\n ],\n \"continents\": [\n \"europe\",\n \"asia\"\n ],\n \"countries\": [\n \"us\",\n \"gb\",\n \"lu\"\n ],\n \"ip\": [\n \"192.168.15.150/25\",\n \"2003:de:2016::/48\"\n ],\n \"weight\": 30\n }\n }\n ],\n \"meta\": {},\n \"pickers\": [\n {\n \"limit\": 123,\n \"strict\": true\n }\n ],\n \"ttl\": 123\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resource_records\": [\n {\n \"content\": [\n 100,\n 1,\n 5061,\n \"example.com\"\n ],\n \"enabled\": true,\n \"meta\": {\n \"asn\": [\n 17544,\n 17812\n ],\n \"continents\": [\n \"europe\",\n \"asia\"\n ],\n \"countries\": [\n \"us\",\n \"gb\",\n \"lu\"\n ],\n \"ip\": [\n \"192.168.15.150/25\",\n \"2003:de:2016::/48\"\n ],\n \"weight\": 30\n }\n }\n ],\n \"meta\": {},\n \"pickers\": [\n {\n \"limit\": 123,\n \"strict\": true\n }\n ],\n \"ttl\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/dns/v2/zones/{zoneName}/{rrsetName}/{rrsetType}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_records\": [\n {\n \"content\": [\n 100,\n 1,\n 5061,\n \"example.com\"\n ],\n \"enabled\": true,\n \"meta\": {\n \"asn\": [\n 17544,\n 17812\n ],\n \"continents\": [\n \"europe\",\n \"asia\"\n ],\n \"countries\": [\n \"us\",\n \"gb\",\n \"lu\"\n ],\n \"ip\": [\n \"192.168.15.150/25\",\n \"2003:de:2016::/48\"\n ],\n \"weight\": 30\n }\n }\n ],\n \"meta\": {},\n \"pickers\": [\n {\n \"limit\": 123,\n \"strict\": true\n }\n ],\n \"ttl\": 123\n}"
response = http.request(request)
puts response.read_body{
"name": "sub.example.com",
"resource_records": [
{
"content": [
100,
1,
5061,
"example.com"
],
"enabled": true,
"id": 42,
"meta": {
"continents": [
"europe",
"asia"
],
"countries": [
"us",
"gb",
"lu"
],
"ip": [
"192.168.15.150/25",
"2003:de:2016::/48"
]
}
}
],
"filter_set_id": 123,
"meta": {},
"pickers": [
{
"limit": 123,
"strict": true
}
],
"ttl": 123,
"updated_at": "2023-11-07T05:31:56Z",
"warning": "<string>",
"warnings": [
{
"key": "<string>",
"message": "<string>"
}
]
}This response has no body data.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
OutputRRSet
Example:
"sub.example.com"
List of resource record from rrset
Show child attributes
Show child attributes
RRSet type
Available options:
A, AAAA, NS, CNAME, MX, TXT, SRV, SOA, PTR, SVCB, HTTPS, CAA, DS Meta information for rrset. Map with string key and any valid json as value, with valid keys
failover(object, beta feature, might be changed in the future) can have fields 1.1.protocol(string, required, HTTP, TCP, UDP, ICMP) 1.2.port(int, required, 1-65535) 1.3.frequency(int, required, in seconds 10-3600) 1.4.timeout(int, required, in seconds 1-10), 1.5.method(string, only for protocol=HTTP) 1.6.command(string, bytes to be sent only for protocol=TCP/UDP) 1.7.url(string, only for protocol=HTTP) 1.8.tls(bool, only for protocol=HTTP) 1.9.regexp(string regex to match, only for non-ICMP) 1.10.http_status_code(int, only for protocol=HTTP) 1.11.host(string, only for protocol=HTTP)geodns_link(string) - name of the geodns link to use, if previously set, must re-send when updating or CDN integration will be removed for this RRSet
Show child attributes
Show child attributes
Example:
{}
Set of pickers
Show child attributes
Show child attributes
Timestamp marshals/unmarshals date and time as timestamp in json
Warning about some possible side effects without strictly disallowing operations on rrset readonly Deprecated: use Warnings instead
Warning about some possible side effects without strictly disallowing operations on rrset readonly
Show child attributes
Show child attributes
Was this page helpful?
⌘I