Flexible A/AAAA Record Matching
A records map domain names to IPv4 addresses, and AAAA records map to IPv6 addresses. Flexible matching allows you to verify specific IP addresses are configured while permitting customers to add additional addresses for load balancing, redundancy, or multi-CDN setups.
Why Flexible A/AAAA Matching
Modern applications often use multiple IP addresses for high availability, geographic distribution, and failover. Exact matching becomes problematic when customers need to add or adjust their infrastructure.
The Exact Matching Problem
curl -X POST https://api.dnsradar.dev/monitors \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": true
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": true
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": true
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": true
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": true
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": true
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": true
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": true
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);If the customer adds a third server for load balancing (9.10.11.12), exact matching triggers a false MISMATCH alert.
Enabling Flexible Matching
Use is_exact_match: false to verify your required IPs exist while allowing additional addresses:
curl -X POST https://api.dnsradar.dev/monitors \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": false
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": false
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": false
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": false
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": false
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": false
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": false
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4",
"5.6.7.8"
],
"is_exact_match": false
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);How It Works
With flexible matching for A/AAAA records, DNSRadar:
- Verifies all IP addresses in your
expected_valueare present - Ignores additional IP addresses not in your list
- Considers the monitor VALID as long as your required IPs exist
- Triggers
MISMATCHonly if required IPs are removed
Valid Configurations
With the flexible configuration above, these A record sets would all be VALID:
# Exactly your IPs
1.2.3.4
5.6.7.8
# With additional IPs
1.2.3.4
5.6.7.8
9.10.11.12
# Mixed with many others
1.2.3.4
5.6.7.8
10.20.30.40
50.60.70.80
100.110.120.130
All contain your required IP addresses 1.2.3.4 and 5.6.7.8, so they pass validation.
IPv6 (AAAA) Monitoring
Flexible matching works identically for IPv6 addresses:
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": "AAAA",
"expected_value": [
"2001:db8::1",
"2001:db8::2"
],
"is_exact_match": false
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1",
"2001:db8::2"
],
"is_exact_match": false
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1",
"2001:db8::2"
],
"is_exact_match": false
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1",
"2001:db8::2"
],
"is_exact_match": false
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1",
"2001:db8::2"
],
"is_exact_match": false
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1",
"2001:db8::2"
],
"is_exact_match": false
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1",
"2001:db8::2"
],
"is_exact_match": false
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1",
"2001:db8::2"
],
"is_exact_match": false
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);When Monitors Trigger
A MISMATCH alert is triggered if:
- One or more of your required IP addresses are removed
- All A/AAAA records are removed
- DNS query returns an error
IP Additions Safe: Adding new IP addresses never triggers alerts with flexible matching, enabling customers to scale their infrastructure freely.
Common Use Cases
CDN and Origin Monitoring
Ensure your origin server remains configured while allowing CDN IPs:
curl -X POST https://api.dnsradar.dev/monitors \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "cdn.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10"
],
"is_exact_match": false,
"group": "cdn-configuration"
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "cdn.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10"
],
"is_exact_match": false,
"group": "cdn-configuration"
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "cdn.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10"
],
"is_exact_match": false,
"group": "cdn-configuration"
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "cdn.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10"
],
"is_exact_match": false,
"group": "cdn-configuration"
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "cdn.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10"
],
"is_exact_match": false,
"group": "cdn-configuration"
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "cdn.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10"
],
"is_exact_match": false,
"group": "cdn-configuration"
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "cdn.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10"
],
"is_exact_match": false,
"group": "cdn-configuration"
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "cdn.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10"
],
"is_exact_match": false,
"group": "cdn-configuration"
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);Dual Stack Monitoring
Monitor both IPv4 and IPv6:
curl -X POST https://api.dnsradar.dev/monitors/bulk \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "dual-stack-monitoring"
}'const response = await fetch('https://api.dnsradar.dev/monitors/bulk', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "dual-stack-monitoring"
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors/bulk',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "dual-stack-monitoring"
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors/bulk')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "dual-stack-monitoring"
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "dual-stack-monitoring"
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors/bulk", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors/bulk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "dual-stack-monitoring"
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "dual-stack-monitoring"
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors/bulk"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "dual-stack-monitoring"
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors/bulk",
content
);Load Balancer Configuration
Ensure specific load balancer IPs remain configured:
curl -X POST https://api.dnsradar.dev/monitors \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "app.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100",
"10.0.2.100"
],
"is_exact_match": false
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "app.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100",
"10.0.2.100"
],
"is_exact_match": false
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "app.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100",
"10.0.2.100"
],
"is_exact_match": false
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "app.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100",
"10.0.2.100"
],
"is_exact_match": false
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "app.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100",
"10.0.2.100"
],
"is_exact_match": false
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "app.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100",
"10.0.2.100"
],
"is_exact_match": false
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "app.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100",
"10.0.2.100"
],
"is_exact_match": false
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "app.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100",
"10.0.2.100"
],
"is_exact_match": false
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);Multi-Region Deployment
Monitor presence of regional endpoints:
curl -X POST https://api.dnsradar.dev/monitors \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"52.0.0.1",
"13.0.0.1",
"18.0.0.1"
],
"is_exact_match": false,
"frequency": 5
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"52.0.0.1",
"13.0.0.1",
"18.0.0.1"
],
"is_exact_match": false,
"frequency": 5
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"52.0.0.1",
"13.0.0.1",
"18.0.0.1"
],
"is_exact_match": false,
"frequency": 5
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"52.0.0.1",
"13.0.0.1",
"18.0.0.1"
],
"is_exact_match": false,
"frequency": 5
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"52.0.0.1",
"13.0.0.1",
"18.0.0.1"
],
"is_exact_match": false,
"frequency": 5
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"52.0.0.1",
"13.0.0.1",
"18.0.0.1"
],
"is_exact_match": false,
"frequency": 5
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"52.0.0.1",
"13.0.0.1",
"18.0.0.1"
],
"is_exact_match": false,
"frequency": 5
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"52.0.0.1",
"13.0.0.1",
"18.0.0.1"
],
"is_exact_match": false,
"frequency": 5
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);Best Practices
- Monitor Critical IPs Only: Specify only the IP addresses essential to your service
- Use Flexible Matching by Default: Enable it unless you need strict IP control
- Combine with Health Checks: DNS monitoring verifies configuration; use separate health checks for service availability
- Monitor Both IPv4 and IPv6: Create separate monitors for A and AAAA records
- Group Related Monitors: Organize monitors by service or infrastructure component
Advanced Scenarios
Anycast IP Monitoring
Verify anycast IPs are advertised:
curl -X POST https://api.dnsradar.dev/monitors \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "anycast.piedpiper.com",
"record_type": "A",
"expected_value": [
"192.0.2.1"
],
"is_exact_match": false,
"frequency": 5
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "anycast.piedpiper.com",
"record_type": "A",
"expected_value": [
"192.0.2.1"
],
"is_exact_match": false,
"frequency": 5
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "anycast.piedpiper.com",
"record_type": "A",
"expected_value": [
"192.0.2.1"
],
"is_exact_match": false,
"frequency": 5
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "anycast.piedpiper.com",
"record_type": "A",
"expected_value": [
"192.0.2.1"
],
"is_exact_match": false,
"frequency": 5
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "anycast.piedpiper.com",
"record_type": "A",
"expected_value": [
"192.0.2.1"
],
"is_exact_match": false,
"frequency": 5
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "anycast.piedpiper.com",
"record_type": "A",
"expected_value": [
"192.0.2.1"
],
"is_exact_match": false,
"frequency": 5
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "anycast.piedpiper.com",
"record_type": "A",
"expected_value": [
"192.0.2.1"
],
"is_exact_match": false,
"frequency": 5
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "anycast.piedpiper.com",
"record_type": "A",
"expected_value": [
"192.0.2.1"
],
"is_exact_match": false,
"frequency": 5
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);Subnet Monitoring
Monitor multiple IPs from the same subnet:
curl -X POST https://api.dnsradar.dev/monitors \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "cluster.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.10",
"10.0.1.11",
"10.0.1.12"
],
"is_exact_match": false
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "cluster.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.10",
"10.0.1.11",
"10.0.1.12"
],
"is_exact_match": false
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "cluster.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.10",
"10.0.1.11",
"10.0.1.12"
],
"is_exact_match": false
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "cluster.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.10",
"10.0.1.11",
"10.0.1.12"
],
"is_exact_match": false
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "cluster.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.10",
"10.0.1.11",
"10.0.1.12"
],
"is_exact_match": false
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "cluster.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.10",
"10.0.1.11",
"10.0.1.12"
],
"is_exact_match": false
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "cluster.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.10",
"10.0.1.11",
"10.0.1.12"
],
"is_exact_match": false
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "cluster.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.10",
"10.0.1.11",
"10.0.1.12"
],
"is_exact_match": false
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);Failover Configuration
Ensure both primary and failover IPs exist:
curl -X POST https://api.dnsradar.dev/monitors \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "service.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10",
"203.0.113.20"
],
"is_exact_match": false,
"group": "high-availability"
}'const response = await fetch('https://api.dnsradar.dev/monitors', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "service.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10",
"203.0.113.20"
],
"is_exact_match": false,
"group": "high-availability"
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"domain": "service.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10",
"203.0.113.20"
],
"is_exact_match": false,
"group": "high-availability"
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"domain": "service.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10",
"203.0.113.20"
],
"is_exact_match": false,
"group": "high-availability"
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "service.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10",
"203.0.113.20"
],
"is_exact_match": false,
"group": "high-availability"
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"domain": "service.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10",
"203.0.113.20"
],
"is_exact_match": false,
"group": "high-availability"
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"domain": "service.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10",
"203.0.113.20"
],
"is_exact_match": false,
"group": "high-availability"
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"domain": "service.piedpiper.com",
"record_type": "A",
"expected_value": [
"203.0.113.10",
"203.0.113.20"
],
"is_exact_match": false,
"group": "high-availability"
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors",
content
);Integration Examples
Infrastructure as Code
# Terraform/Pulumi example
monitors:
- domain: api.example.com
record_type: A
expected_value:
- 1.2.3.4 # Primary load balancer
- 5.6.7.8 # Backup load balancer
is_exact_match: false
frequency: 5
group: production-api
Automated Monitoring Setup
// Automatically monitor all production services
const services = await getProductionServices()
const monitors = services.map(service => ({
domain: service.domain,
record_type: service.ipv6 ? 'AAAA' : 'A',
expected_value: service.criticalIPs,
is_exact_match: false,
frequency: 5,
group: 'production-infrastructure'
}))
await dnsradar.monitors.bulkCreate({ monitors })
Comparing Flexible vs Exact Matching
| Scenario | Exact Match | Flexible Match |
|---|---|---|
| Customer adds IPs | ❌ MISMATCH | ✅ VALID |
| Customer removes required IP | ❌ MISMATCH | ❌ MISMATCH |
| Customer removes non-required IP | ❌ MISMATCH | ✅ VALID |
| IP order changes | ✅ VALID | ✅ VALID |
| All IPs removed | ❌ MISMATCH | ❌ MISMATCH |
Monitoring Complete Service Stack
curl -X POST https://api.dnsradar.dev/monitors/bulk \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "www.piedpiper.com",
"record_type": "CNAME",
"expected_value": "piedpiper.netlify.app"
},
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100"
],
"is_exact_match": false
},
{
"domain": "api.piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "service-infrastructure",
"frequency": 5
}'const response = await fetch('https://api.dnsradar.dev/monitors/bulk', {
method: 'POST',
headers: {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "www.piedpiper.com",
"record_type": "CNAME",
"expected_value": "piedpiper.netlify.app"
},
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100"
],
"is_exact_match": false
},
{
"domain": "api.piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "service-infrastructure",
"frequency": 5
})
});
const data = await response.json();import requests
response = requests.post(
'https://api.dnsradar.dev/monitors/bulk',
headers={
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "www.piedpiper.com",
"record_type": "CNAME",
"expected_value": "piedpiper.netlify.app"
},
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100"
],
"is_exact_match": false
},
{
"domain": "api.piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "service-infrastructure",
"frequency": 5
}
)require 'net/http'
require 'json'
uri = URI('https://api.dnsradar.dev/monitors/bulk')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['X-API-Key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = {
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "www.piedpiper.com",
"record_type": "CNAME",
"expected_value": "piedpiper.netlify.app"
},
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100"
],
"is_exact_match": false
},
{
"domain": "api.piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "service-infrastructure",
"frequency": 5
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "www.piedpiper.com",
"record_type": "CNAME",
"expected_value": "piedpiper.netlify.app"
},
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100"
],
"is_exact_match": false
},
{
"domain": "api.piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "service-infrastructure",
"frequency": 5
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.dnsradar.dev/monitors/bulk", bytes.NewBuffer(jsonData))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
response, _ := client.Do(req)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.dnsradar.dev/monitors/bulk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = json_encode({
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "www.piedpiper.com",
"record_type": "CNAME",
"expected_value": "piedpiper.netlify.app"
},
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100"
],
"is_exact_match": false
},
{
"domain": "api.piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "service-infrastructure",
"frequency": 5
});
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);import java.net.http.*;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String json = """{
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "www.piedpiper.com",
"record_type": "CNAME",
"expected_value": "piedpiper.netlify.app"
},
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100"
],
"is_exact_match": false
},
{
"domain": "api.piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "service-infrastructure",
"frequency": 5
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.dnsradar.dev/monitors/bulk"))
.header("X-API-Key", "YOUR_API_KEY")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());using System.Net.Http;
using System.Text;
using System.Text.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
var data = new
{
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "A",
"expected_value": [
"1.2.3.4"
],
"is_exact_match": false
},
{
"domain": "www.piedpiper.com",
"record_type": "CNAME",
"expected_value": "piedpiper.netlify.app"
},
{
"domain": "api.piedpiper.com",
"record_type": "A",
"expected_value": [
"10.0.1.100"
],
"is_exact_match": false
},
{
"domain": "api.piedpiper.com",
"record_type": "AAAA",
"expected_value": [
"2001:db8::1"
],
"is_exact_match": false
}
],
"group": "service-infrastructure",
"frequency": 5
};
var json = JsonSerializer.Serialize(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.dnsradar.dev/monitors/bulk",
content
);