Look up a CAA record from the command line

· 3 min read

A CAA record states which certificate authorities may issue certificates for a domain. Get it wrong and the next renewal fails with no warning beforehand. This guide shows the lookup with dig, nslookup, PowerShell and host, explains the three properties, and why the search climbs upward for subdomains.

CAA record lookup

The query is an ordinary DNS lookup with type CAA. Pick your tool and enter the domain.

Tool

Only inserted into the commands in your browser.

dig · Linux, macOS

Each line is one CAA record: flag, property and value. issue names the certificate authority allowed to issue. An empty answer means no CAA record, so any CA may issue.

Shell
dig +short CAA example.com
Sample output
0 issue "letsencrypt.org"
0 issuewild "letsencrypt.org"
0 iodef "mailto:security@example.com"

nslookup · Windows, Linux, macOS

nslookup on Linux and macOS does not know CAA by name and prints "rdata_257" (CAA is record type 257). The value after it is correct. On Windows use the PowerShell variant.

Shell
nslookup -type=CAA example.com
Sample output
Non-authoritative answer:
example.com	rdata_257 = 0 issue "letsencrypt.org"
example.com	rdata_257 = 0 issuewild "letsencrypt.org"

PowerShell · Windows

Resolve-DnsName cannot query the CAA type. This call asks Google's public resolver over HTTPS instead; the record is in the data field. If there is none, the output is empty.

PowerShell
(Invoke-RestMethod "https://dns.google/resolve?name=example.com&type=CAA").Answer

host · Linux, macOS

The short form for Linux and macOS.

Shell
host -t CAA example.com
Sample output
example.com has CAA record 0 issue "letsencrypt.org"
example.com has CAA record 0 issuewild "letsencrypt.org"

Most domains have no CAA record; the answer is then empty with status NOERROR. That is allowed and simply means no restriction.

Reading issue, issuewild and iodef

A CAA record consists of a flag (almost always 0), a property and a quoted value:

  • issue "letsencrypt.org": this CA may issue certificates for the domain. Several CAs each get their own record.
  • issuewild "letsencrypt.org": applies to wildcard certificates (*.example.com) only. Without issuewild, issue covers them.
  • issue ";": the empty value forbids every CA from issuing. Useful for domains that will never need a certificate.
  • iodef "mailto:security@example.com": where a CA can report rejected requests. Few CAs use it.
  • The value is the CA's identifier, not its brand name: letsencrypt.org, pki.goog (Google Trust Services), digicert.com, sectigo.com. The CA's documentation states the right one.

Subdomains: the search climbs upward

Before issuing, a CA checks the exact name first. If there is no CAA record, it asks the next level up and so on to the root, that is beyond the registered domain up to the TLD (RFC 8659). The first hit wins. In practice the search ends at your own domain or without a hit; for www.shop.example.com you take the same steps:

Shell
dig +short CAA www.shop.example.com
dig +short CAA shop.example.com
dig +short CAA example.com

If the name is a CNAME, dig prints the target first and then its CAA records: the check follows the alias. That is the usual surprise when a subdomain points by CNAME to a service provider whose CAA records do not list your CA.

When issuance fails because of CAA

It is almost always one of these:

  • The CA reports something like "CAA record for example.com prevents issuance": the record names a different CA. Add an issue record for the CA your host or ACME client actually uses.
  • The wildcard certificate fails, the regular one does not: an issuewild record excludes the CA while issue allows it.
  • Your host switches CAs: many platforms move to another CA without notice. A narrow CAA record then blocks automatic renewal.
  • SERVFAIL on the lookup: a CA must not issue when the lookup errors. The cause is often DNSSEC or a name server that does not answer CAA queries cleanly.
  • The record was created as TXT in the editor: then it is not a CAA record. The type has to be CAA; if your DNS host does not offer it, CAA cannot be set there.
  • nslookup prints "rdata_257": not an error, just how it displays type 257.

Checking without a terminal

The CAA record checker finds the effective CAA set from the host name upward, breaks down issue, issuewild and iodef and compares the allowed authorities with the issuer of the certificate the server currently presents. You see before expiry whether the next renewal will go through.

Frequently asked questions

How do I look up a CAA record with dig?
dig +short CAA example.com. Each line of the answer is one record with flag, property (issue, issuewild, iodef) and value. An empty answer means no CAA record is set.
What happens when there is no CAA record?
Then any publicly trusted certificate authority may issue a certificate, provided it validates control of the domain. CAA is optional.
Does Resolve-DnsName work with CAA?
No. The -Type parameter of Resolve-DnsName does not include CAA. On Windows use a DNS-over-HTTPS query or an online check.
Does a CAA record apply to subdomains?
Yes, as long as the subdomain has no CAA record of its own. The CA searches from the exact name upward and takes the first match.
Check now

Free CAA record check: issue, issuewild and iodef, matched against the CA of your current certificate. Shows whether the next renewal is going to fail.

DomainWarn checks CAA records and certificates of all client domains on a schedule and reports changes and expiring certificates before a renewal fails.

Monitor this domain continuously14-day free trial, no credit card.

More guides