Skip to main content

Email Domain DNS

Validate a domain's email authentication DNS records (SPF, DKIM, DMARC) and receive a scored grade with actionable recommendations.

Domain DNS Check

GET /v1/email/domain/{domain}/dns

Path Parameters

ParameterTypeRequiredDescription
domainstringYesDomain name to check (e.g. example.com)

Query Parameters

ParameterTypeDefaultDescription
selectorsstringcommon selectorsComma-separated DKIM selectors to check

When selectors is omitted, the system probes a set of commonly used DKIM selectors (google, default, selector1, selector2, etc.). Only selectors that are found in DNS are included in the response. When explicit selectors are provided, all are returned regardless of whether they resolve.

Response (200)

{
"data": {
"domain": "example.com",
"domain_auth_score": 85,
"grade": "B",
"mx": {
"records": ["mx1.example.com", "mx2.example.com"],
"is_valid": true
},
"spf": {
"raw": "v=spf1 include:_spf.google.com ~all",
"mechanisms": ["include:_spf.google.com", "~all"],
"all_qualifier": "~",
"is_valid": true,
"is_permissive": false,
"dns_lookup_count": 3,
"exceeds_lookups": false
},
"dkim": [
{
"selector": "google",
"found": true,
"key_type": "rsa",
"key_bits": 2048,
"is_valid": true
}
],
"dmarc": {
"raw": "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
"policy": "quarantine",
"subdomain_policy": "quarantine",
"percentage": 100,
"aggregate_report_uris": ["mailto:dmarc@example.com"],
"dkim_alignment": "r",
"spf_alignment": "r",
"report_interval": 86400,
"strength_rating": "moderate",
"is_valid": true
},
"recommendations": [
"Consider upgrading DMARC policy from quarantine to reject for maximum protection"
]
},
"meta": {
"processing_time_ms": 450
}
}

Response Fields

Top-Level

FieldTypeDescription
domainstringThe checked domain
domain_auth_scoreintegerAuthentication score (0-100)
gradestringLetter grade (A-F)
mxobjectMX record results
spfobjectSPF record analysis
dkimarrayDKIM record results per selector
dmarcobjectDMARC record analysis
recommendationsarrayActionable improvement suggestions

MX Object

FieldTypeDescription
recordsarrayMX hostnames found
is_validbooleanWhether MX records are valid
errorsarrayValidation errors (if any)

SPF Object

FieldTypeDescription
rawstringRaw SPF TXT record
mechanismsarrayParsed SPF mechanisms
all_qualifierstringThe all qualifier (+, -, ~, ?)
is_validbooleanWhether the record is valid
is_permissivebooleanTrue if uses +all (dangerous)
validation_errorsarrayValidation errors (if any)
dns_lookup_countintegerNumber of DNS lookups required
exceeds_lookupsbooleanWhether it exceeds the 10-lookup RFC limit

DKIM Object (per selector)

FieldTypeDescription
selectorstringDKIM selector name
foundbooleanWhether the selector exists in DNS
rawstringRaw DKIM TXT record
key_typestringKey type (rsa, ed25519)
key_bitsintegerKey size in bits
is_validbooleanWhether the record is valid
validation_errorsarrayValidation errors (if any)

DMARC Object

FieldTypeDescription
rawstringRaw DMARC TXT record
policystringPolicy (none, quarantine, reject)
subdomain_policystringSubdomain policy
percentageintegerPercentage of messages subject to policy
aggregate_report_urisarrayrua addresses
forensic_report_urisarrayruf addresses
dkim_alignmentstringDKIM alignment (r=relaxed, s=strict)
spf_alignmentstringSPF alignment (r=relaxed, s=strict)
failure_optionsstringFailure options (fo=)
report_intervalintegerReport interval in seconds
strength_ratingstringweak, moderate, or strong
is_validbooleanWhether the record is valid
validation_errorsarrayValidation errors (if any)

Grading

GradeScoreDescription
A90-100Excellent email authentication
B75-89Good, minor improvements possible
C55-74Moderate risk, missing configurations
D35-54Poor, significant gaps
F0-34Critical, minimal or no authentication

Score Breakdown

The score is computed from four components:

ComponentMax PointsCriteria
MX10Valid MX records present
SPF25Valid SPF with strict qualifier
DKIM30Valid DKIM with 2048+ bit key
DMARC35Valid DMARC with reject policy at 100%

Error Responses

400 Bad Request

{
"data": {
"error": "missing domain parameter",
"code": "MISSING_DOMAIN"
},
"meta": {
"processing_time_ms": 0
}
}

Code Examples

cURL

# Basic domain check
curl -X GET "https://api.limesindex.com/v1/email/domain/example.com/dns" \
-H "X-API-Key: YOUR_API_KEY"

# With specific DKIM selectors
curl -X GET "https://api.limesindex.com/v1/email/domain/example.com/dns?selectors=google,selector1,s1" \
-H "X-API-Key: YOUR_API_KEY"

Python

import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.limesindex.com"
HEADERS = {"X-API-Key": API_KEY}

resp = requests.get(
f"{BASE_URL}/v1/email/domain/example.com/dns",
headers=HEADERS
)
data = resp.json()["data"]

print(f"Domain: {data['domain']}")
print(f"Grade: {data['grade']} (Score: {data['domain_auth_score']})")
print(f"DMARC Policy: {data['dmarc']['policy']}")
print(f"SPF Valid: {data['spf']['is_valid']}")

if data["recommendations"]:
print("\nRecommendations:")
for rec in data["recommendations"]:
print(f" - {rec}")

Use Cases

  • Domain onboarding: Validate authentication before adding a domain to your sending infrastructure
  • Customer diagnostics: Check why a customer's domain has deliverability issues
  • Continuous monitoring: Periodically verify that DNS records have not been misconfigured
  • Sales qualification: Assess prospect readiness for email marketing based on domain health