Domains without DKIM / DMARC
A domain without DKIM and DMARC records gives receiving mail servers no way to verify that mail claiming to come from it is genuine. You can list your tenant's domains and look up both DNS records with a read-only Microsoft Graph PowerShell script.
Why it matters
DKIM adds a digital signature to outgoing mail, and DMARC tells receiving servers what to do with mail that fails authentication. Microsoft explains that DKIM lets a domain's mail be validated by the receiver (Microsoft Learn: Use DKIM for email in your custom domain) and that DMARC works with the SPF and DKIM results to decide how failing messages are handled (Microsoft Learn: Use DMARC to validate email). A domain with neither is easier for others to spoof.
Find it yourself
This script is read-only: it lists domains with Microsoft Graph (Microsoft Learn: List domains) and then only performs public DNS lookups. It creates or changes nothing.
Connect-MgGraph -Scopes "Domain.Read.All"
Get-MgDomain -All |
Where-Object { -not $_.Id.EndsWith(".onmicrosoft.com") } |
ForEach-Object {
$d = $_.Id
$dmarc = Resolve-DnsName "_dmarc.$d" -Type TXT -ErrorAction SilentlyContinue
$dkim1 = Resolve-DnsName "selector1._domainkey.$d" -Type CNAME -ErrorAction SilentlyContinue
$dkim2 = Resolve-DnsName "selector2._domainkey.$d" -Type CNAME -ErrorAction SilentlyContinue
[pscustomobject]@{
Domain = $d
Dmarc = [bool]$dmarc
Dkim1 = [bool]$dkim1
Dkim2 = [bool]$dkim2
}
}
Disconnect-MgGraphRead the result
Each row is one custom domain. Dmarc = False means no DMARC TXT record was found at _dmarc for that domain. Dkim1 and Dkim2 are the two selector records Microsoft 365 uses for DKIM; False means the CNAME is not published. A published CNAME shows the record exists, not that signing is switched on, so confirm the DKIM state in the Microsoft Defender portal. Where a DMARC record exists, read its policy value: a policy of none only monitors and does not tell receivers to act on failing mail.
What to do next
For each domain that sends mail, publish the two DKIM selector CNAME records at your DNS host and enable DKIM signing for the domain, following the Microsoft article above. Then publish a DMARC record. Many teams start with a monitoring policy and move to a stricter one once reports show legitimate mail passes. Domains that never send mail still deserve a DMARC record, so nobody can spoof them.
See it continuously
ConfigCobra's Microsoft 365 inventory includes a built-in risk view for domains without DKIM / DMARC. Findings are linked to the inventory objects they concern, and you can export the view as CSV. Scheduled scans (daily, weekly or monthly) and ad hoc scans keep it current, and email notifications tell you about drift. ConfigCobra is read-only and never changes your tenant.
Go further
- Inventory & InsightsEvery user, app, device and resource in one inventory, with built-in risk views
- Identity & Access GovernanceFind inactive users, guests, admins and risky apps
- Microsoft 365CIS v7.0.0 · 160 controls · read-only Microsoft Graph
- Users inactive 90 daysMicrosoft 365 insight
- Users who never signed inMicrosoft 365 insight
- Users with no MFA registeredMicrosoft 365 insight
- External mail forwardingMicrosoft 365 insight
See it for your whole tenant, continuously
Inventory & Insights lists these risks with built-in views and CSV export, read-only.