Skip to content

List DNS names in a zone

GET /v1/dns/records/{zone_name}

Lists the dns names of the user in a given zone. Results can be sorted using the sort parameter, and filtered by name metadata using metadata filter expressions.

Path Parameters

zone_name

The name of the zone.

Example: example.com

Query Parameters

offset integer

Offset from beginning of list

Example: 0

Minimum: 0

limit integer

Maximum number of results to return

Example: 20

Minimum: 0

sort object

Sort options: (allowed fields: name, name_labels_reversed, created_at; allowed sorting: asc, desc).

Example:

{
"created_at": "asc",
"name": "asc",
"name_labels_reversed": "asc"
}
metadata string

The metadata expression format.

The metadata filter expression is a JSON string, defined by the Expression type. It is used to filter out results based on their metadata.

We support conditions that operate in textual, numeric, or datetime values.

For example, the expression { "op": "exact", "key": "key1", "value": "value1" } will only yield results with a metadata key named key1 that contains the value value1.

For example, the expression { "op": "lt", "key": "key2", "value": 10 } will only yield results with a metadata key named key2 that contains a numeric value less than 10.

Textual conditions

A Textual condition is defined by the TextCondition type:

type TextCondition = {
op: TextOp;
key: string;
value: string;
};

A Textual condition can only be used with the exact or contains operators.

type TextOp = "exact" | "contains";

Numeric and datetime conditions.

Numeric and datetime conditions are defined by the OrdinalCondition type:

type OrdinalCondition = {
op: OrdinalOp;
key: string;
value: Ordinal;
};

Numeric values can be any JSON number value. Datetime must be RFC 3339 date strings.

type Ordinal = number | Datetime;
type Datetime = string;

Numeric and Datetime values can be used with the following equality and comparison operators:

type OrdinalOp = "eq" | "lt" | "le" | "gt" | "ge" | "neq";

And clauses.

Numeric, datetime and textual conditions can be combined using and and or clauses. The AndClause combines one or more Condition, and only yields results where all the conditions are true.

type Condition = OrdinalCondition | TextCondition;
type AndClause = { and: Condition[] };

Example:

{
"and": [
{ "op" : "contains", "key": "key1", "value": "value1" },
{ "op" : "exact" , "key": "key2", "value": "value2" }
]
}

Or clauses.

The OrClause combines one or more Condition, and only yields results if any of the conditions are true.

type OrClause = { or: (AndClause | Condition)[] };

Example:

{
"or": [
{ "op" : "contains", "key": "key1", "value": "value1" },
{ "op" : "exact" , "key": "key2", "value": "value2" }
]
}

Nested clauses.

We support limited nesting. AndClauses can be nested inside of an AndClause.

Example:

{
"or": [
{ "op" : "contains", "key": "key1", "value": "value1" },
{ "and": [
{ "op" : "contains", "key": "key2", "value": "value2" },
{ "op" : "exact" , "key": "key3", "value": "value3" }
] }
]
}

A complete Expression can be formed by a single Condition, and AndClause, or and OrClause, nested or not.

type Expression = AndClause | OrClause | Condition;

Example: {"or":[{"and":[{"op":"contains","key":"key1","value":"value1"},{"op":"exact","key":"key2","value":"value2"}]},{"op":"exact","key":"key3","value":"value3"}]}

Response