Zone RRSets

Create an RRSet

Create an RRSet in the Zone.

Only applicable for Zones in primary mode.

Operation specific errors

StatusCodeDescription
422incorrect_zone_modeThis operation is not supported for this Zone's mode.
post/zones/{id_or_name}/rrsets

Request

  • Base URL: https://api.hetzner.cloud/v1
  • URL: https://api.hetzner.cloud/v1/zones/{id_or_name}/rrsets
  • Auth: HTTP bearer

Path parameters

id_or_namestring required

ID or Name of the Zone.

ID or Name of the Zone.

Request body

namestring required

Name of the RRSet.

The name must be in lower case, and must not end with a dot or the Zone name. Names containing non-ASCII characters must be transcribed to Punycode representation with ACE prefix, e.g. xn--4bi (✉️).

For the Zone apex, use @.

type'A' | 'AAAA' | 'CAA' | 'CNAME' | 'DS' | 'HINFO' | 'HTTPS' | 'MX' | 'NS' | 'PTR' | 'RP' | 'SOA' | 'SRV' | 'SVCB' | 'TLSA' | 'TXT' required

Type of the RRSet.

ttlinteger nullable

Time To Live (TTL) of the RRSet.

Must be in between 60s and 2147483647s.

If not set, the Zone's Default TTL is used.

labelsobject

User-defined labels (key/value pairs) for the Resource. For more information, see "Labels".

Example request

{
  "name": "www",
  "type": "A",
  "ttl": 3600,
  "records": [
    {
      "value": "198.51.100.1",
      "comment": "My web server at Hetzner Cloud."
    }
  ],
  "labels": {
    "environment": "prod",
    "example.com/my": "label",
    "just-a-key": ""
  }
}

Response

Request succeeded.

Example response

{
  "rrset": {
    "name": "www",
    "type": "A",
    "ttl": 3600,
    "labels": {
      "environment": "prod",
      "example.com/my": "label",
      "just-a-key": ""
    },
    "records": [
      {
        "value": "198.51.100.1",
        "comment": "My web server at Hetzner Cloud."
      }
    ],
    "zone": 42
  },
  "action": {
    "id": 42,
    "command": "start_resource",
    "started": "2016-01-30T23:55:00Z",
    "finished": "2016-01-30T23:55:00Z",
    "progress": 100,
    "resources": [
      {
        "id": 42,
        "type": "server"
      }
    ],
    "error": {
      "code": "action_failed",
      "message": "Action failed"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.