DNS records

List, create, update and delete the DNS records of a zone, in bulk or as one batch, and import existing records.

On this page

DNS records of a zone. A/AAAA/CNAME records can be proxied: the name then answers with the edge addresses and the record content becomes the origin. In an external zone only proxied A/AAAA/CNAME records are accepted (they are the sites served by the edge). Every write creates a new configuration version.

OperationEndpoint
List recordsGET /v1/orgs/{org}/zones/{zone}/records
Create recordPOST /v1/orgs/{org}/zones/{zone}/records
Create records in bulkPOST /v1/orgs/{org}/zones/{zone}/records/bulk
Batch recordsPOST /v1/orgs/{org}/zones/{zone}/records/batch
Get recordGET /v1/orgs/{org}/zones/{zone}/records/{record}
Update recordPATCH /v1/orgs/{org}/zones/{zone}/records/{record}
Delete recordDELETE /v1/orgs/{org}/zones/{zone}/records/{record}
Find existing recordsGET /v1/orgs/{org}/zones/{zone}/import
Read a BIND zone filePOST /v1/orgs/{org}/zones/{zone}/import/bind
Get edge DNS answersGET /v1/orgs/{org}/zones/{zone}/dns/answers

List records

GET /v1/orgs/{org}/zones/{zone}/records

Lists the DNS records of a zone with their ids.

Required role: readonly or higher.

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).

Response

  • 200: Returns items, an array of Record.
FieldTypeDescription
items[].idstring (uuid)Id.
items[].org_idstring (uuid)Organization id.
items[].zone_idstring (uuid)Zone id.
items[].typestring
items[].namestringFull name without a trailing dot.
items[].contentstringOrigin content.
items[].ttlintegerTTL in seconds.
items[].priorityintegerMX and SRV priority (null for other types).
items[].proxiedbooleanServed through the OpenWAF edge.
items[].commentstringComment (empty if none).
items[].tagsarray of stringTags (empty list if none).
items[].created_atstring (date-time)Creation time.
items[].updated_atstring (date-time)Last change.

Example

curl "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/records" \
  -H "Authorization: Bearer $OPENWAF_TOKEN"
200
{
  "items": [
    {
      "id": "0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d",
      "org_id": "1e7c9a3b-5d2f-4b8a-9c6e-0f2a4b6c8d1e",
      "zone_id": "6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d",
      "type": "A",
      "name": "www.example.com",
      "content": "203.0.113.10",
      "ttl": 300,
      "priority": null,
      "proxied": true,
      "comment": "Web servers",
      "tags": [
        "web"
      ],
      "created_at": "2026-03-02T10:25:00Z",
      "updated_at": "2026-10-27T09:00:00Z"
    }
  ]
}

Create record

POST /v1/orgs/{org}/zones/{zone}/records

Creates a DNS record. In an external zone only proxied A/AAAA/CNAME records are accepted (they are the sites published to the edge); they are not published in DNS, which stays with the other provider.

Required role: tech or higher.

Change controls: dry_run · If-Match (optional) · X-Change-Reason (required)

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).
X-Change-ReasonheaderstringYesReason of the change: 1-500 UTF-8 characters after trimming spaces, no control characters. If it is missing or invalid: 422 reason_required. 1 to 500 characters.
If-MatchheaderstringNoExpected configuration version, e.g. "12" (W/ accepted). If it is not the current one: 412 version_conflict.
dry_runquerystringNo1/true simulates the change: answers 200 with the plan (Applied) and saves nothing. 0/false accepted; any other value: 400. One of 1, true, 0, false.

Request body

Content type application/json. Schema: RecordInput.

FieldTypeRequiredDescription
typestringYesOne of A, AAAA, CNAME, MX, TXT, NS, SRV, CAA.
namestringNo@, relative (www) or full name; * for a wildcard. Default @.
contentstringYesA/AAAA: address. CNAME/NS/MX: host name. TXT: text without quotes (split into 255-character strings). SRV: weight port target. CAA: flags tag "value".
ttlintegerNoTTL in seconds. Default 3600. From 60 to 86400.
priorityintegerNoRequired for MX and SRV; not allowed for other types. From 0 to 65535.
proxiedbooleanNoA/AAAA/CNAME only. The name answers with the edge addresses (TTL 300) and the content is kept as the origin. All A/AAAA/CNAME records of a name share the value. An unproxied CNAME at the apex is published flattened (ALIAS). Default false.
commentstringNoAttribute of the record (not published in DNS; part of the zone's versions). No control characters. At most 100 characters.
tagsarray of stringNoAttribute of the record, like the comment. Lowercased and deduplicated. At most 10 items. Items match ^[a-z0-9][a-z0-9:_-]{0,31}$.

Response

  • 200: With dry_run=1, the plan of the change (Applied); nothing is saved.
  • 201: Created and published. Returns Record.
FieldTypeDescription
idstring (uuid)Id.
org_idstring (uuid)Organization id.
zone_idstring (uuid)Zone id.
typestring
namestringFull name without a trailing dot.
contentstringOrigin content.
ttlintegerTTL in seconds.
priorityintegerMX and SRV priority (null for other types).
proxiedbooleanServed through the OpenWAF edge.
commentstringComment (empty if none).
tagsarray of stringTags (empty list if none).
created_atstring (date-time)Creation time.
updated_atstring (date-time)Last change.

Response headers: ETag, X-Config-Version.

Errors

StatusDescription
400Malformed request (bad_request).
409Disabled zone, or zone_merged.
412version_conflict: If-Match does not match the current version.
422Validation error (invalid) or missing or invalid reason (reason_required).

Example

curl -X POST "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/records" \
  -H "Authorization: Bearer $OPENWAF_TOKEN" \
  -H "X-Change-Reason: Add the API host" \
  -H 'If-Match: "12"' \
  -H "Content-Type: application/json" \
  --data '{
    "type": "A",
    "name": "api",
    "content": "203.0.113.20",
    "proxied": true
  }'
201
{
  "id": "0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d",
  "org_id": "1e7c9a3b-5d2f-4b8a-9c6e-0f2a4b6c8d1e",
  "zone_id": "6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d",
  "type": "A",
  "name": "www.example.com",
  "content": "203.0.113.10",
  "ttl": 300,
  "priority": null,
  "proxied": true,
  "comment": "Web servers",
  "tags": [
    "web"
  ],
  "created_at": "2026-03-02T10:25:00Z",
  "updated_at": "2026-10-27T09:00:00Z"
}

Create records in bulk

POST /v1/orgs/{org}/zones/{zone}/records/bulk

Creates up to 1000 records atomically, all or none, as one version (for example a reviewed import). A validation error names the record in field (records[i].field).

Required role: tech or higher.

Change controls: dry_run · If-Match (optional) · X-Change-Reason (required)

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).
X-Change-ReasonheaderstringYesReason of the change: 1-500 UTF-8 characters after trimming spaces, no control characters. If it is missing or invalid: 422 reason_required. 1 to 500 characters.
If-MatchheaderstringNoExpected configuration version, e.g. "12" (W/ accepted). If it is not the current one: 412 version_conflict.
dry_runquerystringNo1/true simulates the change: answers 200 with the plan (Applied) and saves nothing. 0/false accepted; any other value: 400. One of 1, true, 0, false.

Request body

Content type application/json.

FieldTypeRequiredDescription
recordsarray of RecordInputYesAt most 1000 items.
records[].typestringYesOne of A, AAAA, CNAME, MX, TXT, NS, SRV, CAA.
records[].namestringNo@, relative (www) or full name; * for a wildcard. Default @.
records[].contentstringYesA/AAAA: address. CNAME/NS/MX: host name. TXT: text without quotes (split into 255-character strings). SRV: weight port target. CAA: flags tag "value".
records[].ttlintegerNoTTL in seconds. Default 3600. From 60 to 86400.
records[].priorityintegerNoRequired for MX and SRV; not allowed for other types. From 0 to 65535.
records[].proxiedbooleanNoA/AAAA/CNAME only. The name answers with the edge addresses (TTL 300) and the content is kept as the origin. All A/AAAA/CNAME records of a name share the value. An unproxied CNAME at the apex is published flattened (ALIAS). Default false.
records[].commentstringNoAttribute of the record (not published in DNS; part of the zone's versions). No control characters. At most 100 characters.
records[].tagsarray of stringNoAttribute of the record, like the comment. Lowercased and deduplicated. At most 10 items. Items match ^[a-z0-9][a-z0-9:_-]{0,31}$.

Response

  • 200: With dry_run=1, the plan of the change (Applied); nothing is saved.
  • 201: Created (one version). Returns items, an array of Record.
FieldTypeDescription
items[].idstring (uuid)Id.
items[].org_idstring (uuid)Organization id.
items[].zone_idstring (uuid)Zone id.
items[].typestring
items[].namestringFull name without a trailing dot.
items[].contentstringOrigin content.
items[].ttlintegerTTL in seconds.
items[].priorityintegerMX and SRV priority (null for other types).
items[].proxiedbooleanServed through the OpenWAF edge.
items[].commentstringComment (empty if none).
items[].tagsarray of stringTags (empty list if none).
items[].created_atstring (date-time)Creation time.
items[].updated_atstring (date-time)Last change.

Response headers: ETag, X-Config-Version.

Errors

StatusDescription
400Malformed request (bad_request).
409zone_merged: the zone is merged into another one (read-only until it is unmerged or purged).
412version_conflict: If-Match does not match the current version.
422Validation error (field names records[i].field) or reason_required.

Example

curl -X POST "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/records/bulk" \
  -H "Authorization: Bearer $OPENWAF_TOKEN" \
  -H "X-Change-Reason: Import reviewed records" \
  -H "Content-Type: application/json" \
  --data '{
    "records": [
      {
        "type": "A",
        "name": "@",
        "content": "203.0.113.10",
        "proxied": true
      },
      {
        "type": "MX",
        "name": "@",
        "content": "mail.example.com",
        "priority": 10
      }
    ]
  }'
201
{
  "items": [
    {
      "id": "0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d",
      "org_id": "1e7c9a3b-5d2f-4b8a-9c6e-0f2a4b6c8d1e",
      "zone_id": "6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d",
      "type": "A",
      "name": "www.example.com",
      "content": "203.0.113.10",
      "ttl": 300,
      "priority": null,
      "proxied": true,
      "comment": "Web servers",
      "tags": [
        "web"
      ],
      "created_at": "2026-03-02T10:25:00Z",
      "updated_at": "2026-10-27T09:00:00Z"
    }
  ]
}

Batch records

POST /v1/orgs/{org}/zones/{zone}/records/batch

Creates, updates and deletes records as one change, all or nothing, with one version, one reason and one audit entry per record. Turning the proxy on or off for an A/AAAA/CNAME also changes the other A/AAAA/CNAME records of the same name that are not in the batch. The answer (200) is the plan of the change plus the resulting records of the zone.

Required role: tech or higher.

Change controls: dry_run · If-Match (optional) · X-Change-Reason (required)

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).
X-Change-ReasonheaderstringYesReason of the change: 1-500 UTF-8 characters after trimming spaces, no control characters. If it is missing or invalid: 422 reason_required. 1 to 500 characters.
If-MatchheaderstringNoExpected configuration version, e.g. "12" (W/ accepted). If it is not the current one: 412 version_conflict.
dry_runquerystringNo1/true simulates the change: answers 200 with the plan (Applied) and saves nothing. 0/false accepted; any other value: 400. One of 1, true, 0, false.

Request body

Content type application/json. Schema: RecordBatch.

Up to 500 operations in total. Each record is updated or deleted at most once. Deletes are applied first, then updates, then creates; coexistence rules are checked on the final state.

FieldTypeRequiredDescription
createarray of RecordInputNo
create[].typestringYesOne of A, AAAA, CNAME, MX, TXT, NS, SRV, CAA.
create[].namestringNo@, relative (www) or full name; * for a wildcard. Default @.
create[].contentstringYesA/AAAA: address. CNAME/NS/MX: host name. TXT: text without quotes (split into 255-character strings). SRV: weight port target. CAA: flags tag "value".
create[].ttlintegerNoTTL in seconds. Default 3600. From 60 to 86400.
create[].priorityintegerNoRequired for MX and SRV; not allowed for other types. From 0 to 65535.
create[].proxiedbooleanNoA/AAAA/CNAME only. The name answers with the edge addresses (TTL 300) and the content is kept as the origin. All A/AAAA/CNAME records of a name share the value. An unproxied CNAME at the apex is published flattened (ALIAS). Default false.
create[].commentstringNoAttribute of the record (not published in DNS; part of the zone's versions). No control characters. At most 100 characters.
create[].tagsarray of stringNoAttribute of the record, like the comment. Lowercased and deduplicated. At most 10 items. Items match ^[a-z0-9][a-z0-9:_-]{0,31}$.
updatearray of objectNo
update[].idstring (uuid)YesId.
update[].typestringNo
update[].namestringNoName.
update[].contentstringNo
update[].ttlintegerNoTTL in seconds.
update[].priorityinteger or nullNoMX and SRV priority (null for other types).
update[].proxiedbooleanNoServed through the OpenWAF edge.
update[].commentstringNoAt most 100 characters.
update[].tagsarray of stringNoAt most 10 items. Items match ^[a-z0-9][a-z0-9:_-]{0,31}$.
deletearray of string (uuid)No

Response

  • 200: Applied (or simulated with dry_run). Returns BatchResult.
FieldTypeDescription
dry_runbooleantrue in a simulation.
from_versionintegerCurrent version before the change.
to_versionintegerVersion the change creates (the same if nothing changes).
diffDiffChanges.
warningsarray of stringWarnings (the change is still valid).
recordsarray of RecordRecords of the zone after the change (simulated with dry_run).

Response headers: ETag, X-Config-Version.

Errors

StatusDescription
400Malformed request (bad_request).
409Disabled zone, or zone_merged.
412version_conflict: If-Match does not match the current version.
422Validation error (field names the operation: create[i].field, update[i].field, delete[i]; empty if the batch is empty or has more than 500 operations) or reason_required.

Example

curl -X POST "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/records/batch?dry_run=1" \
  -H "Authorization: Bearer $OPENWAF_TOKEN" \
  -H "X-Change-Reason: Move the site to the new origin" \
  -H "Content-Type: application/json" \
  --data '{
    "create": [
      {
        "type": "CNAME",
        "name": "shop",
        "content": "shops.example.net",
        "proxied": true
      }
    ],
    "update": [
      {
        "id": "0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d",
        "content": "203.0.113.30"
      }
    ],
    "delete": [
      "1b3d5f7a-9c2e-4a6b-8d0f-2a4c6e8b0d2f"
    ]
  }'
200
{
  "dry_run": false,
  "from_version": 12,
  "to_version": 12,
  "diff": {
    "from": 0,
    "to": 0,
    "changes": [
      {
        "path": "rules[id=12]",
        "op": "add",
        "from": "example",
        "to": "example"
      }
    ]
  },
  "warnings": [],
  "records": [
    {
      "id": "0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d",
      "org_id": "1e7c9a3b-5d2f-4b8a-9c6e-0f2a4b6c8d1e",
      "zone_id": "6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d",
      "type": "A",
      "name": "www.example.com",
      "content": "203.0.113.10",
      "ttl": 300,
      "priority": null,
      "proxied": true,
      "comment": "Web servers",
      "tags": [
        "web"
      ],
      "created_at": "2026-03-02T10:25:00Z",
      "updated_at": "2026-10-27T09:00:00Z"
    }
  ]
}

Get record

GET /v1/orgs/{org}/zones/{zone}/records/{record}

Returns one record. For a proxied record, content is the origin.

Required role: readonly or higher.

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).
recordpathstring (uuid)YesRecord id (see List records).

Response

FieldTypeDescription
idstring (uuid)Id.
org_idstring (uuid)Organization id.
zone_idstring (uuid)Zone id.
typestring
namestringFull name without a trailing dot.
contentstringOrigin content.
ttlintegerTTL in seconds.
priorityintegerMX and SRV priority (null for other types).
proxiedbooleanServed through the OpenWAF edge.
commentstringComment (empty if none).
tagsarray of stringTags (empty list if none).
created_atstring (date-time)Creation time.
updated_atstring (date-time)Last change.

Errors

StatusDescription
404Not found, or not visible to the token (not_found).

Example

curl "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/records/0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d" \
  -H "Authorization: Bearer $OPENWAF_TOKEN"
200
{
  "id": "0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d",
  "org_id": "1e7c9a3b-5d2f-4b8a-9c6e-0f2a4b6c8d1e",
  "zone_id": "6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d",
  "type": "A",
  "name": "www.example.com",
  "content": "203.0.113.10",
  "ttl": 300,
  "priority": null,
  "proxied": true,
  "comment": "Web servers",
  "tags": [
    "web"
  ],
  "created_at": "2026-03-02T10:25:00Z",
  "updated_at": "2026-10-27T09:00:00Z"
}

Update record

PATCH /v1/orgs/{org}/zones/{zone}/records/{record}

Changes fields of a record; fields left out keep their value.

Required role: tech or higher.

Change controls: dry_run · If-Match (optional) · X-Change-Reason (required)

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).
recordpathstring (uuid)YesRecord id (see List records).
X-Change-ReasonheaderstringYesReason of the change: 1-500 UTF-8 characters after trimming spaces, no control characters. If it is missing or invalid: 422 reason_required. 1 to 500 characters.
If-MatchheaderstringNoExpected configuration version, e.g. "12" (W/ accepted). If it is not the current one: 412 version_conflict.
dry_runquerystringNo1/true simulates the change: answers 200 with the plan (Applied) and saves nothing. 0/false accepted; any other value: 400. One of 1, true, 0, false.

Request body

Content type application/json. Schema: RecordPatch.

Fields that change; the others keep their value.

FieldTypeRequiredDescription
typestringNo
namestringNoName.
contentstringNo
ttlintegerNoTTL in seconds.
priorityinteger or nullNoMX and SRV priority (null for other types).
proxiedbooleanNoServed through the OpenWAF edge.
commentstringNoAt most 100 characters.
tagsarray of stringNoAt most 10 items. Items match ^[a-z0-9][a-z0-9:_-]{0,31}$.

Response

  • 200: Record changed (with X-Config-Version and ETag) or, with dry_run, the plan (Applied). Returns Record or Applied.
FieldTypeDescription
idstring (uuid)Id.
org_idstring (uuid)Organization id.
zone_idstring (uuid)Zone id.
typestring
namestringFull name without a trailing dot.
contentstringOrigin content.
ttlintegerTTL in seconds.
priorityintegerMX and SRV priority (null for other types).
proxiedbooleanServed through the OpenWAF edge.
commentstringComment (empty if none).
tagsarray of stringTags (empty list if none).
created_atstring (date-time)Creation time.
updated_atstring (date-time)Last change.

Response headers: ETag, X-Config-Version.

Errors

StatusDescription
400Malformed request (bad_request).
409zone_merged: the zone is merged into another one (read-only until it is unmerged or purged).
412version_conflict: If-Match does not match the current version.
422Validation error (invalid) or missing or invalid reason (reason_required).

Example

curl -X PATCH "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/records/0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d" \
  -H "Authorization: Bearer $OPENWAF_TOKEN" \
  -H "X-Change-Reason: Point www at the new origin" \
  -H 'If-Match: "12"' \
  -H "Content-Type: application/json" \
  --data '{
    "content": "203.0.113.30"
  }'
200
{
  "id": "0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d",
  "org_id": "1e7c9a3b-5d2f-4b8a-9c6e-0f2a4b6c8d1e",
  "zone_id": "6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d",
  "type": "A",
  "name": "www.example.com",
  "content": "203.0.113.10",
  "ttl": 300,
  "priority": null,
  "proxied": true,
  "comment": "Web servers",
  "tags": [
    "web"
  ],
  "created_at": "2026-03-02T10:25:00Z",
  "updated_at": "2026-10-27T09:00:00Z"
}

Delete record

DELETE /v1/orgs/{org}/zones/{zone}/records/{record}

Deletes a record. Deleting a proxied record stops serving its site.

Required role: tech or higher.

Change controls: dry_run · If-Match (optional) · X-Change-Reason (required)

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).
recordpathstring (uuid)YesRecord id (see List records).
X-Change-ReasonheaderstringYesReason of the change: 1-500 UTF-8 characters after trimming spaces, no control characters. If it is missing or invalid: 422 reason_required. 1 to 500 characters.
If-MatchheaderstringNoExpected configuration version, e.g. "12" (W/ accepted). If it is not the current one: 412 version_conflict.
dry_runquerystringNo1/true simulates the change: answers 200 with the plan (Applied) and saves nothing. 0/false accepted; any other value: 400. One of 1, true, 0, false.

Response

  • 200: With dry_run=1, the plan of the change (Applied); nothing is saved.
  • 204: Deleted. No body.

Response headers: ETag, X-Config-Version.

Errors

StatusDescription
400Malformed request (bad_request).
404Not found, or not visible to the token (not_found).
409zone_merged: the zone is merged into another one (read-only until it is unmerged or purged).
412version_conflict: If-Match does not match the current version.
422Validation error (invalid) or missing or invalid reason (reason_required).

Example

curl -X DELETE "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/records/0c9a7e4d-2b1f-4e6a-8d3c-5f7b9a1c3e5d" \
  -H "Authorization: Bearer $OPENWAF_TOKEN" \
  -H "X-Change-Reason: Remove an unused host" \
  -H 'If-Match: "12"'

Find existing records

GET /v1/orgs/{org}/zones/{zone}/import

Queries the current authoritative servers (or public resolvers) for the apex, common names, mail TXT records, SRV records and names seen in Certificate Transparency logs, and returns them for review. Nothing is applied; send the reviewed list to Create records in bulk or Batch records.

Required role: tech or higher.

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).

Response

FieldTypeDescription
domainstring
serversarray of string
wildcardboolean
warningsarray of stringWarnings (the change is still valid).
candidatesarray of object
candidates[].typestringOne of A, AAAA, CNAME, MX, TXT, NS, SRV, CAA.
candidates[].namestring@, relative (www) or full name; * for a wildcard. Default @.
candidates[].contentstringA/AAAA: address. CNAME/NS/MX: host name. TXT: text without quotes (split into 255-character strings). SRV: weight port target. CAA: flags tag "value".
candidates[].ttlintegerTTL in seconds. Default 3600. From 60 to 86400.
candidates[].priorityintegerRequired for MX and SRV; not allowed for other types. From 0 to 65535.
candidates[].proxiedbooleanA/AAAA/CNAME only. The name answers with the edge addresses (TTL 300) and the content is kept as the origin. All A/AAAA/CNAME records of a name share the value. An unproxied CNAME at the apex is published flattened (ALIAS). Default false.
candidates[].commentstringAttribute of the record (not published in DNS; part of the zone's versions). No control characters. At most 100 characters.
candidates[].tagsarray of stringAttribute of the record, like the comment. Lowercased and deduplicated. At most 10 items. Items match ^[a-z0-9][a-z0-9:_-]{0,31}$.
candidates[].sourcestringOne of dns, crtsh.

Example

curl "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/import" \
  -H "Authorization: Bearer $OPENWAF_TOKEN"
200
{
  "domain": "example",
  "servers": [
    "example"
  ],
  "wildcard": false,
  "warnings": [],
  "candidates": [
    {
      "type": "A",
      "name": "example.com",
      "content": "203.0.113.10",
      "ttl": 3600,
      "priority": 0,
      "proxied": false,
      "comment": "Web servers",
      "tags": [
        "web"
      ],
      "source": "dns"
    }
  ]
}

Read a BIND zone file

POST /v1/orgs/{org}/zones/{zone}/import/bind

Reads a BIND zone file (up to 1 MiB) and returns the records it contains for review. Nothing is applied; apply the chosen candidates with Batch records. Not available in external zones.

It understands $ORIGIN, $TTL, @, relative names, inherited owners, parentheses, comments and multi-string TXT records. It leaves out, with the reason, the SOA and the apex NS records (OpenWAF sets them), other directives, unsupported types or classes, names outside the zone, invalid records, records that already exist in the zone and duplicates.

Required role: tech or higher.

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).
proxiedquerybooleanNoProxy the A/AAAA/CNAME records whose name can be a site (no wildcards or _). Default false.

Request body

Content type text/plain.

At most 1048576 characters.

Response

FieldTypeDescription
itemsarray of object
items[].typestringOne of A, AAAA, CNAME, MX, TXT, NS, SRV, CAA.
items[].namestring@, relative (www) or full name; * for a wildcard. Default @.
items[].contentstringA/AAAA: address. CNAME/NS/MX: host name. TXT: text without quotes (split into 255-character strings). SRV: weight port target. CAA: flags tag "value".
items[].ttlintegerTTL in seconds. Default 3600. From 60 to 86400.
items[].priorityintegerRequired for MX and SRV; not allowed for other types. From 0 to 65535.
items[].proxiedbooleanA/AAAA/CNAME only. The name answers with the edge addresses (TTL 300) and the content is kept as the origin. All A/AAAA/CNAME records of a name share the value. An unproxied CNAME at the apex is published flattened (ALIAS). Default false.
items[].commentstringAttribute of the record (not published in DNS; part of the zone's versions). No control characters. At most 100 characters.
items[].tagsarray of stringAttribute of the record, like the comment. Lowercased and deduplicated. At most 10 items. Items match ^[a-z0-9][a-z0-9:_-]{0,31}$.
items[].sourcestringAlways file.
skippedarray of objectAt most 200 entries; skipped_total counts them all.
skipped[].lineintegerLine where the entry starts.
skipped[].textstringEntry without comments (up to 200 bytes).
skipped[].reasonstringReason of the change.
skipped_totalintegerEntries left out (all of them, even if skipped only lists the first 200).
truncatedbooleanThe file had more than 5000 entries: only the first 5000 were read.

Errors

StatusDescription
400Malformed request (bad_request).
404Not found, or not visible to the token (not_found).
409External zone.
413too_large: the file is larger than 1 MiB.

Example

curl -X POST "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/import/bind" \
  -H "Authorization: Bearer $OPENWAF_TOKEN" \
  -H "Content-Type: text/plain" \
  --data-binary @example.com.zone
200
{
  "items": [
    {
      "type": "A",
      "name": "example.com",
      "content": "203.0.113.10",
      "ttl": 3600,
      "priority": 0,
      "proxied": false,
      "comment": "Web servers",
      "tags": [
        "web"
      ],
      "source": "file"
    }
  ],
  "skipped": [
    {
      "line": 0,
      "text": "example",
      "reason": "Point www at the new origin"
    }
  ],
  "skipped_total": 128,
  "truncated": false
}

Get edge DNS answers

GET /v1/orgs/{org}/zones/{zone}/dns/answers

For a delegated zone, returns the addresses that OpenWAF DNS publishes for each proxied name (the edge addresses) and whether the published answer is up to date (in_sync; if not, it is corrected automatically).

Required role: readonly or higher.

Parameters

NameInTypeRequiredDescription
orgpathstring (uuid)YesOrganization id. Every route checks that it is the token's organization (otherwise 404).
zonepathstring (uuid)YesZone id (see List zones).

Response

FieldTypeDescription
ipv4array of string
ipv6array of string
namesarray of object
names[].namestringName.
names[].in_syncboolean
names[].rrsetsarray of object

Errors

StatusDescription
404Not found, or not visible to the token (not_found).
409conflict: the zone is external (another provider serves its DNS).
503The DNS service is not available right now.

Example

curl "https://dash.openwaf.dev/v1/orgs/$OPENWAF_ORG/zones/6f1d2c3b-8a4e-4b7d-9c21-5e3f7a8b9c0d/dns/answers" \
  -H "Authorization: Bearer $OPENWAF_TOKEN"
200
{
  "ipv4": [
    "example"
  ],
  "ipv6": [
    "example"
  ],
  "names": [
    {
      "name": "example.com",
      "in_sync": false,
      "rrsets": [
        {}
      ]
    }
  ]
}

Last updated:

↑↓ to navigate↵ to openesc to close