Get a DNS Zone
GET/dns-zones/ {dnsZoneId}/
v2
GET
dns-get-dns-zone
Request
- dnsZoneIdstring (uuid)required
The ID of the zone to be retrieved.
Responses
application/json
The requested DNSZone.
- Schema documentation
- Example
- JSON Schema
- domainstringrequired
- idstring (uuid)required
- recordSetobjectrequired
- cnameone of 2 alternativesrequired
- combinedARecordsone of 3 alternativesrequired
- mxone of 3 alternativesrequired
- srvone of 2 alternativesrequired
- txtone of 2 alternativesrequired
{
"domain": "string",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"recordSet": {
"cname": {},
"combinedARecords": {},
"mx": {},
"srv": {},
"txt": {}
}
}
{
"properties": {
"domain": {
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"recordSet": {
"properties": {
"cname": {
"oneOf": [
{
"additionalProperties": false,
"properties": {},
"type": "object"
},
{
"properties": {
"fqdn": {
"format": "idn-dnsname",
"type": "string"
},
"settings": {
"properties": {
"ttl": {
"oneOf": [
{
"properties": {
"seconds": {
"maximum": 86400,
"minimum": 300,
"type": "integer"
}
},
"required": [
"seconds"
],
"type": "object"
},
{
"properties": {
"auto": {
"description": "this will always be true",
"type": "boolean"
}
},
"required": [
"auto"
],
"type": "object"
}
]
}
},
"type": "object"
}
},
"required": [
"settings",
"fqdn"
],
"type": "object"
}
]
},
"combinedARecords": {
"oneOf": [
{
"additionalProperties": false,
"properties": {},
"type": "object"
},
{
"properties": {
"a": {
"items": {
"format": "ipv4",
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"aaaa": {
"items": {
"format": "ipv6",
"type": "string"
},
"maxItems": 10,
"type": "array"
},
"settings": {
"properties": {
"ttl": {
"oneOf": [
{
"properties": {
"seconds": {
"maximum": 86400,
"minimum": 300,
"type": "integer"
}
},
"required": [
"seconds"
],
"type": "object"
},
{
"properties": {
"auto": {
"description": "this will always be true",
"type": "boolean"
}
},
"required": [
"auto"
],
"type": "object"
}
]
}
},
"type": "object"
}
},
"required": [
"settings",
"a",
"aaaa"
],
"type": "object"
},
{
"properties": {
"managedBy": {
"oneOf": [
{
"properties": {
"ingressId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"ingressId"
],
"type": "object"
}
]
}
},
"required": [
"managedBy"
],
"type": "object"
}
]
},
"mx": {
"oneOf": [
{
"additionalProperties": false,
"properties": {},
"type": "object"
},
{
"properties": {
"managed": {
"type": "boolean"
}
},
"required": [
"managed"
],
"type": "object"
},
{
"properties": {
"records": {
"items": {
"properties": {
"fqdn": {
"format": "idn-dnsname",
"maxLength": 50,
"minLength": 1,
"type": "string"
},
"priority": {
"maximum": 100,
"minimum": 0,
"type": "integer"
}
},
"required": [
"priority",
"fqdn"
],
"type": "object"
},
"maxItems": 10,
"minItems": 1,
"type": "array",
"uniqueItems": true
},
"settings": {
"properties": {
"ttl": {
"oneOf": [
{
"properties": {
"seconds": {
"maximum": 86400,
"minimum": 300,
"type": "integer"
}
},
"required": [
"seconds"
],
"type": "object"
},
{
"properties": {
"auto": {
"description": "this will always be true",
"type": "boolean"
}
},
"required": [
"auto"
],
"type": "object"
}
]
}
},
"type": "object"
}
},
"required": [
"settings",
"records"
],
"type": "object"
}
]
},
"srv": {
"oneOf": [
{
"additionalProperties": false,
"properties": {},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"records": {
"items": {
"additionalProperties": false,
"properties": {
"fqdn": {
"format": "idn-dnsname",
"maxLength": 50,
"minLength": 1,
"type": "string"
},
"port": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"priority": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"weight": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
}
},
"required": [
"port",
"fqdn"
],
"type": "object"
},
"minItems": 1,
"type": "array"
},
"settings": {
"properties": {
"ttl": {
"oneOf": [
{
"properties": {
"seconds": {
"maximum": 86400,
"minimum": 300,
"type": "integer"
}
},
"required": [
"seconds"
],
"type": "object"
},
{
"properties": {
"auto": {
"description": "this will always be true",
"type": "boolean"
}
},
"required": [
"auto"
],
"type": "object"
}
]
}
},
"type": "object"
}
},
"required": [
"settings",
"records"
],
"type": "object"
}
]
},
"txt": {
"oneOf": [
{
"additionalProperties": false,
"properties": {},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"entries": {
"items": {
"maxLength": 2048,
"type": "string"
},
"maxItems": 20,
"type": "array"
},
"settings": {
"properties": {
"ttl": {
"oneOf": [
{
"properties": {
"seconds": {
"maximum": 86400,
"minimum": 300,
"type": "integer"
}
},
"required": [
"seconds"
],
"type": "object"
},
{
"properties": {
"auto": {
"description": "this will always be true",
"type": "boolean"
}
},
"required": [
"auto"
],
"type": "object"
}
]
}
},
"type": "object"
}
},
"required": [
"settings",
"entries"
],
"type": "object"
}
]
}
},
"required": [
"combinedARecords",
"cname",
"mx",
"txt",
"srv"
],
"type": "object"
}
},
"required": [
"id",
"domain",
"recordSet"
],
"type": "object"
}
Usage examples
- cURL
- JavaScript SDK
- PHP SDK
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/dns-zones/f0f86186-0a5a-45b2-aa33-502777496347
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.domain.dnsGetDnsZone({
"dnsZoneId": "f0f86186-0a5a-45b2-aa33-502777496347"
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Domain\DnsGetDnsZone\DnsGetDnsZoneRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new DnsGetDnsZoneRequest(
dnsZoneId: "f0f86186-0a5a-45b2-aa33-502777496347"
));
$response = $client->domain()->dnsGetDnsZone($request);
var_dump($response->getBody();