Create a DNS Monitor

Creating a DNS monitor with DNSRadar is straightforward. Monitors allow you to track specific DNS records and receive notifications when changes are detected.

This guide will walk you through creating monitors using the API.

Basic Monitor Creation

To create a monitor, send a POST request to the /monitors endpoint with the DNS record details you want to monitor.

curl -X POST https://api.dnsradar.dev/monitors \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "piedpiper.com",
  "record_type": "A",
  "expected_value": [
    "1.2.3.4",
    "5.6.7.8"
  ]
}'

Request Parameters

  • domain (required): The domain name to monitor
  • subdomain (optional): The subdomain to monitor. Omit for apex domain monitoring
  • record_type (required): The type of DNS record (A, AAAA, CNAME, MX, TXT, NS, PTR)
  • expected_value (required): The expected DNS value(s). Can be a string or array of strings
  • frequency (optional): Check frequency in minutes. Default: 60. Options: 5, 10, 15, 30, 60, 120
  • is_exact_match (optional): Whether to require exact value matching. Default: true
  • group (optional): Group slug to organize monitors. Uses default group if not specified

Monitoring with Subdomains

To monitor a specific subdomain, include the subdomain parameter in your request.

curl -X POST https://api.dnsradar.dev/monitors \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "piedpiper.com",
  "subdomain": "www",
  "record_type": "CNAME",
  "expected_value": "piedpiper.netlify.app",
  "frequency": 5
}'

Understanding Expected Values

The expected_value parameter accepts either a single string or an array of strings, depending on your monitoring needs.

Single Value

For DNS records that should have one specific value:

{
  "expected_value": "piedpiper.netlify.app"
}

Multiple Values

For DNS records that may have multiple valid values (like A records with multiple IPs):

{
  "expected_value": ["1.2.3.4", "5.6.7.8"]
}

Grouping Monitors

Groups allow you to organize monitors and manage webhook notifications collectively. By default, monitors are added to your default group, but you can choose another group when creating a Monitor, by passing a "slug".

If you pass a slug that doesn't exists at DNSRadar, we'll create the group for you on the fly.

curl -X POST https://api.dnsradar.dev/monitors \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "piedpiper.com",
  "record_type": "A",
  "expected_value": [
    "1.2.3.4"
  ],
  "group": "production-servers"
}'

If the specified group doesn't exist, it will be created automatically.

API Response

When a monitor is successfully created, the API returns the monitor object with additional system-generated fields:

{
  "uuid": "mon_abc123",
  "created": "2026-01-06T12:34:56Z",
  "domain": "piedpiper.com",
  "subdomain": null,
  "record_type": "A",
  "expected_value": ["1.2.3.4", "5.6.7.8"],
  "current_value": null,
  "is_exact_match": true,
  "state": "UNSET",
  "incidence_count": 0,
  "last_checked": null,
  "is_active": true,
  "frequency": 60
}

Response Fields

  • uuid: Unique identifier for the monitor (prefixed with mon_)
  • created: ISO 8601 timestamp of monitor creation
  • current_value: Current DNS value (null until first check)
  • state: Monitor state (UNSET, VALID, INVALID, TIMEOUT, MISMATCH, NOT_FOUND)
  • incidence_count: Number of incidents/changes detected
  • last_checked: ISO 8601 timestamp of last check
  • is_active: Whether the monitor is actively checking

Monitor States

Understanding monitor states helps you interpret monitoring results:

  • UNSET: Monitor created but not yet checked
  • VALID: DNS record matches expected value
  • MISMATCH: DNS record doesn't match expected value
  • NOT_FOUND: DNS record doesn't exist
  • TIMEOUT: DNS query timed out
  • INVALID: DNS query returned invalid data

Flexible Matching with is_exact_match

The is_exact_match parameter controls how strictly DNSRadar validates DNS records. When set to false, additional behavior applies based on the record type:

curl -X POST https://api.dnsradar.dev/monitors \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "piedpiper.com",
  "record_type": "TXT",
  "expected_value": "v=spf1 include:_spf.service.com",
  "is_exact_match": false
}'

For detailed information about flexible matching:

Rate Limits

Plan Limitations

Next Steps