Flexible DMARC Record Matching
DMARC (Domain-based Message Authentication, Reporting, and Conformance) records define email authentication policies. Flexible matching for DMARC records allows you to verify essential DMARC components are present while giving customers flexibility to adjust policy settings.
Understanding DMARC Monitoring
DMARC records are TXT records published at the _dmarc subdomain. They control how email servers handle authentication failures and where to send reports.
Example DMARC record:
v=DMARC1; p=reject; pct=100; rua=mailto:dmarc@example.com; adkim=s; aspf=s
The Flexibility Problem
With exact matching, any policy adjustment triggers an alert:
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": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject; pct=100; adkim=s; aspf=s",
"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": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject; pct=100; adkim=s; aspf=s",
"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": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject; pct=100; adkim=s; aspf=s",
"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": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject; pct=100; adkim=s; aspf=s",
"is_exact_match": true
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject; pct=100; adkim=s; aspf=s",
"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": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject; pct=100; adkim=s; aspf=s",
"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": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject; pct=100; adkim=s; aspf=s",
"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": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject; pct=100; adkim=s; aspf=s",
"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 changes pct=100 to pct=50 or adds a rua tag for reports, your monitor triggers a false alert.
Enabling Flexible DMARC Matching
Use flexible matching to verify only the DMARC components that matter to you by setting the is_exact_match parameter to false:
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": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"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
);DMARC Version Required: Include v=DMARC1 in your expected_value to indicate DMARC-specific matching rules should apply.
How Flexible Matching Works
With is_exact_match: false for DMARC records, DNSRadar:
- Verifies the record starts with
v=DMARC1 - Checks that all tags in your
expected_valueare present - Ignores additional tags or modified tag values not in your expected value
Valid DMARC Variations
With the flexible configuration above, these DMARC records would all be VALID:
v=DMARC1; p=none
v=DMARC1; p=quarantine; pct=50
v=DMARC1; p=reject; pct=100; rua=mailto:dmarc@example.com
v=DMARC1; p=reject; rua=mailto:reports@example.com; adkim=s; aspf=s
All contain the required v=DMARC1 version tag, so they pass validation.
Monitoring Specific DMARC Tags
Require specific DMARC policy tags while allowing others to vary:
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": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject",
"is_exact_match": false
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; p=reject",
"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
);This ensures the customer maintains a p=reject policy while allowing them to adjust reporting addresses, percentages, and alignment modes.
Enforcing Strict Alignment
Require strict DKIM and SPF alignment:
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": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; adkim=s; aspf=s",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; adkim=s; aspf=s",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; adkim=s; aspf=s",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; adkim=s; aspf=s",
"is_exact_match": false
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; adkim=s; aspf=s",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; adkim=s; aspf=s",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; adkim=s; aspf=s",
"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",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1; adkim=s; aspf=s",
"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
);This configuration ensures both adkim=s (strict DKIM alignment) and aspf=s (strict SPF alignment) are present, regardless of other DMARC settings.
When Monitors Trigger
A MISMATCH alert is triggered if:
- The DMARC record is removed
- The
v=DMARC1version tag is missing - Required tags from your
expected_valueare removed
Policy Evolution: Flexible matching allows customers to gradually strengthen their DMARC policy from p=none to p=quarantine to p=reject without triggering alerts if you're only monitoring for DMARC presence.
DMARC Tag Reference
Common DMARC tags you might want to monitor:
| Tag | Purpose | Example |
|---|---|---|
v | Version (required) | v=DMARC1 |
p | Policy for domain | p=reject |
sp | Policy for subdomains | sp=quarantine |
pct | Percentage of messages to filter | pct=100 |
rua | Aggregate report URI | rua=mailto:dmarc@example.com |
ruf | Forensic report URI | ruf=mailto:forensic@example.com |
adkim | DKIM alignment mode | adkim=s (strict) |
aspf | SPF alignment mode | aspf=r (relaxed) |
Best Practices
- Start with Basic Monitoring: Begin by monitoring for
v=DMARC1presence only - Gradually Add Requirements: As customers mature their email authentication, add policy requirements
- Allow Reporting Flexibility: Don't enforce specific
ruaorrufvalues unless necessary - Document Expectations: Clearly communicate DMARC requirements to customers
- Combine with SPF/DKIM: Monitor DMARC alongside SPF and DKIM for comprehensive email security
Monitoring Email Authentication Stack
Complete email authentication monitoring:
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": "TXT",
"expected_value": "v=spf1 include:_spf.service.com",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "default._domainkey",
"record_type": "TXT",
"expected_value": "v=DKIM1; k=rsa",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "MX",
"expected_value": [
"mx1.mail-provider.com",
"mx2.mail-provider.com"
],
"is_exact_match": true
}
],
"group": "email-authentication"
}'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": "TXT",
"expected_value": "v=spf1 include:_spf.service.com",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "default._domainkey",
"record_type": "TXT",
"expected_value": "v=DKIM1; k=rsa",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "MX",
"expected_value": [
"mx1.mail-provider.com",
"mx2.mail-provider.com"
],
"is_exact_match": true
}
],
"group": "email-authentication"
})
});
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": "TXT",
"expected_value": "v=spf1 include:_spf.service.com",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "default._domainkey",
"record_type": "TXT",
"expected_value": "v=DKIM1; k=rsa",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "MX",
"expected_value": [
"mx1.mail-provider.com",
"mx2.mail-provider.com"
],
"is_exact_match": true
}
],
"group": "email-authentication"
}
)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": "TXT",
"expected_value": "v=spf1 include:_spf.service.com",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "default._domainkey",
"record_type": "TXT",
"expected_value": "v=DKIM1; k=rsa",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "MX",
"expected_value": [
"mx1.mail-provider.com",
"mx2.mail-provider.com"
],
"is_exact_match": true
}
],
"group": "email-authentication"
}.to_json
response = http.request(request)package main
import (
"bytes"
"encoding/json"
"net/http"
)
data := {
"monitors": [
{
"domain": "piedpiper.com",
"record_type": "TXT",
"expected_value": "v=spf1 include:_spf.service.com",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "default._domainkey",
"record_type": "TXT",
"expected_value": "v=DKIM1; k=rsa",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "MX",
"expected_value": [
"mx1.mail-provider.com",
"mx2.mail-provider.com"
],
"is_exact_match": true
}
],
"group": "email-authentication"
}
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": "TXT",
"expected_value": "v=spf1 include:_spf.service.com",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "default._domainkey",
"record_type": "TXT",
"expected_value": "v=DKIM1; k=rsa",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "MX",
"expected_value": [
"mx1.mail-provider.com",
"mx2.mail-provider.com"
],
"is_exact_match": true
}
],
"group": "email-authentication"
});
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": "TXT",
"expected_value": "v=spf1 include:_spf.service.com",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "default._domainkey",
"record_type": "TXT",
"expected_value": "v=DKIM1; k=rsa",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "MX",
"expected_value": [
"mx1.mail-provider.com",
"mx2.mail-provider.com"
],
"is_exact_match": true
}
],
"group": "email-authentication"
}""";
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": "TXT",
"expected_value": "v=spf1 include:_spf.service.com",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "_dmarc",
"record_type": "TXT",
"expected_value": "v=DMARC1",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"subdomain": "default._domainkey",
"record_type": "TXT",
"expected_value": "v=DKIM1; k=rsa",
"is_exact_match": false
},
{
"domain": "piedpiper.com",
"record_type": "MX",
"expected_value": [
"mx1.mail-provider.com",
"mx2.mail-provider.com"
],
"is_exact_match": true
}
],
"group": "email-authentication"
};
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
);