Skip to main content

Fake DNS Record Fixtures API

MOCK DATA

Generate safe DNS record fixtures with type-correct RDATA and coherent SRV RRsets, using reserved domains and documentation addresses only.

Generated test data for fixtures and development

Base URL
/api/dns-records
Capabilities
2 routes Seedable
Last updated
July 29, 2026

GET /api/dns-records

Live requestRuns against the public API
No key required
GET/api/dns-records?count=8&seed=42

Request parameters

Generate a mixed list or constrain every record to one exact DNS type.

ASCII fixture zone below .test or the reserved example.com/.net/.org domains. A final dot is accepted and canonicalized away.

TTL in seconds applied exactly to every generated record.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/dns-records?count=8&seed=42"
const res = await fetch("https://randomapi.dev/api/dns-records?count=8&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/dns-records?count=8&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/dns-records?count=8&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 3
type enum

Generate a mixed list or constrain every record to one exact DNS type.

default: any
allowed: any | A | AAAA | CNAME | MX | TXT | CAA | SRV
example: type=MX
zone string

ASCII fixture zone below .test or the reserved example.com/.net/.org domains. A final dot is accepted and canonicalized away.

default: example.test
allowed: 3 – 191
example: zone=app.example.test
ttl int

TTL in seconds applied exactly to every generated record.

default: 300
allowed: 30 – 86400
example: ttl=3600
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=id,zone
exclude list

Return all fields except these (comma-separated).

example: exclude=port
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 9
id string

Distinct deterministic fixture identifier; not a DNS field.

example: rr_a_00_4e19c0a27b

zone string

Canonical reserved fixture zone without a trailing dot.

example: example.test

owner string (absolute DNS name)

Absolute owner name with a trailing dot; SRV owners include service and protocol labels.

example: host-1-a1b2c3.example.test.

ttl integer

Record TTL in seconds.

example: 300

type string

A | AAAA | CNAME | MX | TXT | CAA | SRV.

example: A

value string

Type-correct RDATA payload: documentation IP, absolute target, TXT text or CAA presentation value.

example: 192.0.2.1

priority integer nullable

Required for MX/SRV and null for every other type.

example: 10

weight integer nullable

SRV weight from 0 through 100; null for all other types.

example: null

port integer nullable

Service-coherent SRV port; null for all other types.

example: null

Documented examples

Build-generated requests and complete responses
3
Mixed safe DNS fixtures
GET /api/dns-records?count=8&seed=42
{
  "data": [
    {
      "id": "rr_mx_00_6cfb6a5c85",
      "zone": "example.test",
      "owner": "example.test.",
      "ttl": 300,
      "type": "MX",
      "value": "mail-1-a95801.example.test.",
      "priority": 10,
      "weight": null,
      "port": null
    },
    {
      "id": "rr_a_01_abeccba6fd",
      "zone": "example.test",
      "owner": "host-2-078f24.example.test.",
      "ttl": 300,
      "type": "A",
      "value": "198.51.100.2",
      "priority": null,
      "weight": null,
      "port": null
    },
    {
      "id": "rr_caa_02_02c05ac838",
      "zone": "example.test",
      "owner": "policy-3-157909.example.test.",
      "ttl": 300,
      "type": "CAA",
      "value": "0 issue \";\"",
      "priority": null,
      "weight": null,
      "port": null
    },
    {
      "id": "rr_aaaa_03_e1ef2ffb70",
      "zone": "example.test",
      "owner": "host6-4-902fda.example.test.",
      "ttl": 300,
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
MX records for an application test zone
GET /api/dns-records?type=MX&zone=mail.example.test&ttl=3600&count=3&seed=7
{
  "data": [
    {
      "id": "rr_mx_00_e2436f61bc",
      "zone": "mail.example.test",
      "owner": "mail.example.test.",
      "ttl": 3600,
      "type": "MX",
      "value": "mail-1-ad92c7.mail.example.test.",
      "priority": 10,
      "weight": null,
      "port": null
    },
    {
      "id": "rr_mx_01_d5cab8a9dd",
      "zone": "mail.example.test",
      "owner": "mail.example.test.",
      "ttl": 3600,
      "type": "MX",
      "value": "mail-2-995c0e.mail.example.test.",
      "priority": 20,
      "weight": null,
      "port": null
    },
    {
      "id": "rr_mx_02_cdce3b5a6e",
      "zone": "mail.example.test",
      "owner": "mail.example.test.",
      "ttl": 3600,
      "type": "MX",
      "value": "mail-3-7cab01.mail.example.test.",
      "priority": 30,
      "weight": null,
      "port": null
    }
  ],
  "meta": {
    "endpoint": "dns-records",
    "count": 3,
    "seed": 7,
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Vendor-neutral CAA denial fixtures
GET /api/dns-records?type=CAA&count=2&seed=19
{
  "data": [
    {
      "id": "rr_caa_00_76736c926a",
      "zone": "example.test",
      "owner": "policy-1-11cd4d.example.test.",
      "ttl": 300,
      "type": "CAA",
      "value": "0 issue \";\"",
      "priority": null,
      "weight": null,
      "port": null
    },
    {
      "id": "rr_caa_01_dc8e7f89f8",
      "zone": "example.test",
      "owner": "policy-2-2e06c6.example.test.",
      "ttl": 300,
      "type": "CAA",
      "value": "0 issue \";\"",
      "priority": null,
      "weight": null,
      "port": null
    }
  ],
  "meta": {
    "endpoint": "dns-records",
    "count": 2,
    "seed": 19,
    "params": {
      "type": "CAA",
      "zone": "example.test",
      "ttl": 300
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

GET /api/dns-records/srv

Live requestRuns against the public API
No key required
GET/api/dns-records/srv?service=https&count=4&seed=42

Request parameters

Derives the SRV service label, protocol and standard fixture port.

ASCII fixture zone below .test or the reserved example.com/.net/.org domains. A final dot is accepted and canonicalized away.

TTL in seconds applied exactly to every generated record.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/dns-records/srv?service=https&count=4&seed=42"
const res = await fetch("https://randomapi.dev/api/dns-records/srv?service=https&count=4&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/dns-records/srv?service=https&count=4&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/dns-records/srv?service=https&count=4&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 3
service enum

Derives the SRV service label, protocol and standard fixture port.

default: https
allowed: https | sip | xmpp-client
example: service=sip
zone string

ASCII fixture zone below .test or the reserved example.com/.net/.org domains. A final dot is accepted and canonicalized away.

default: example.test
allowed: 3 – 191
example: zone=app.example.test
ttl int

TTL in seconds applied exactly to every generated record.

default: 300
allowed: 30 – 86400
example: ttl=3600
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=id,zone
exclude list

Return all fields except these (comma-separated).

example: exclude=port
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 9
id string

Distinct deterministic fixture identifier; not a DNS field.

example: rr_a_00_4e19c0a27b

zone string

Canonical reserved fixture zone without a trailing dot.

example: example.test

owner string (absolute DNS name)

Absolute owner name with a trailing dot; SRV owners include service and protocol labels.

example: host-1-a1b2c3.example.test.

ttl integer

Record TTL in seconds.

example: 300

type string

A | AAAA | CNAME | MX | TXT | CAA | SRV.

example: A

value string

Type-correct RDATA payload: documentation IP, absolute target, TXT text or CAA presentation value.

example: 192.0.2.1

priority integer nullable

Required for MX/SRV and null for every other type.

example: 10

weight integer nullable

SRV weight from 0 through 100; null for all other types.

example: null

port integer nullable

Service-coherent SRV port; null for all other types.

example: null

Documented examples

Build-generated requests and complete responses
3
HTTPS service targets
GET /api/dns-records/srv?service=https&count=4&seed=42
{
  "data": [
    {
      "id": "rr_srv_00_6cfb6a5c85",
      "zone": "example.test",
      "owner": "_https._tcp.example.test.",
      "ttl": 300,
      "type": "SRV",
      "value": "node-1-7a9580.example.test.",
      "priority": 0,
      "weight": 7,
      "port": 443
    },
    {
      "id": "rr_srv_01_8abeccba6f",
      "zone": "example.test",
      "owner": "_https._tcp.example.test.",
      "ttl": 300,
      "type": "SRV",
      "value": "node-2-0078f2.example.test.",
      "priority": 10,
      "weight": 29,
      "port": 443
    },
    {
      "id": "rr_srv_02_02c05ac838",
      "zone": "example.test",
      "owner": "_https._tcp.example.test.",
      "ttl": 300,
      "type": "SRV",
      "value": "node-3-d15790.example.test.",
      "priority": 20,
      "weight": 59,
      "port": 443
    },
    {
      "id": "rr_srv_03_52e1ef2ffb",
      "zone": "example.test",
      "owner": "_https._tcp.example.test.",
      "ttl": 300,
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
SIP over UDP fixture RRset
GET /api/dns-records/srv?service=sip&zone=voice.example.test&ttl=600&count=3&seed=9
{
  "data": [
    {
      "id": "rr_srv_00_22573e779f",
      "zone": "voice.example.test",
      "owner": "_sip._udp.voice.example.test.",
      "ttl": 600,
      "type": "SRV",
      "value": "node-1-51f328.voice.example.test.",
      "priority": 0,
      "weight": 73,
      "port": 5060
    },
    {
      "id": "rr_srv_01_9c9702ad81",
      "zone": "voice.example.test",
      "owner": "_sip._udp.voice.example.test.",
      "ttl": 600,
      "type": "SRV",
      "value": "node-2-630871.voice.example.test.",
      "priority": 10,
      "weight": 22,
      "port": 5060
    },
    {
      "id": "rr_srv_02_747e37f4ac",
      "zone": "voice.example.test",
      "owner": "_sip._udp.voice.example.test.",
      "ttl": 600,
      "type": "SRV",
      "value": "node-3-69839e.voice.example.test.",
      "priority": 20,
      "weight": 9,
      "port": 5060
    }
  ],
  "meta": {
    "endpoint": "dns-records",
    "route": "/srv",
    "count": 3,
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
XMPP client discovery targets
GET /api/dns-records/srv?service=xmpp-client&count=5&seed=21
{
  "data": [
    {
      "id": "rr_srv_00_2476794311",
      "zone": "example.test",
      "owner": "_xmpp-client._tcp.example.test.",
      "ttl": 300,
      "type": "SRV",
      "value": "node-1-b9f15b.example.test.",
      "priority": 0,
      "weight": 15,
      "port": 5222
    },
    {
      "id": "rr_srv_01_31055bc7d2",
      "zone": "example.test",
      "owner": "_xmpp-client._tcp.example.test.",
      "ttl": 300,
      "type": "SRV",
      "value": "node-2-55a5ff.example.test.",
      "priority": 10,
      "weight": 16,
      "port": 5222
    },
    {
      "id": "rr_srv_02_23984fdd33",
      "zone": "example.test",
      "owner": "_xmpp-client._tcp.example.test.",
      "ttl": 300,
      "type": "SRV",
      "value": "node-3-0cde6a.example.test.",
      "priority": 20,
      "weight": 83,
      "port": 5222
    },
    {
      "id": "rr_srv_03_bc22821148",
      "zone": "example.test",
      "owner": "_xmpp-client._tcp.example.test.",
      "ttl": 300,
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates fictional DNS records for resolver UIs, zone editors and infrastructure tests. The root route supports A, AAAA, CNAME, MX, TXT, CAA and SRV. Every type has the correct field mask: MX has priority, SRV has priority/weight/port, and unrelated numeric fields are always null.

All defaults are non-operational. Owners and targets stay below .test or RFC-reserved example domains; A uses the three IPv4 documentation networks and AAAA uses 2001:db8::/32. TXT values are short synthetic labels rather than verification secrets. Vendor-neutral CAA fixtures use 0 issue ";", which authorizes no issuer.

The /srv route creates one coherent RRset: every member has the same owner, TTL, protocol and service-derived port, while target, priority, weight and fixture ID remain independently useful. CNAME is intentionally absent from RRsets because a CNAME owner cannot carry multiple different canonical targets.

Use it for

  • Populate DNS zone editors with safe type-aware fixtures
  • Test nullable MX and SRV controls without live-domain records
  • Exercise service-discovery clients with coherent seeded SRV RRsets

Frequently asked questions

Can these fixtures accidentally point at a live customer domain?

No by default or accepted zone input: names are restricted to .test and the reserved example.com, example.net and example.org namespaces.

Are priority, weight and port valid for every record type?

They follow DNS semantics: MX uses only priority, SRV uses all three, and A/AAAA/CNAME/TXT/CAA return null for all unrelated numeric fields.

Does the SRV route return one coherent RRset?

Yes. A request shares one owner, service, protocol, TTL and derived port; each record has a distinct target and deterministic priority/weight.

Standards & references