Suped

What is the 'q' tag in a DKIM record?

Michael Ko profile picture
Michael Ko
Co-founder & CEO, Suped
Published 1 Dec 2024
Updated 30 Sep 2025
6 min read
Magnifying glass examining DKIM record details on an email envelope
Email authentication protocols like DKIM are crucial for ensuring your messages reach their intended recipients and aren't flagged as spam. Without proper authentication, your emails face a higher risk of being rejected or sent to the junk folder, impacting your communication and reputation.
A DKIM (DomainKeys Identified Mail) record is a specialized DNS TXT record containing various tags, each with a specific function. These tags instruct receiving mail servers on how to authenticate your email. Among these, the 'q' tag plays a unique role, defining how a server should query for the public key required to verify the email's digital signature.

Decoding DKIM records

A DKIM record is essentially a digital signature for your emails. When you send an email, your server signs it with a private key. The corresponding public key is published in your domain's DNS as a TXT record. Receiving mail servers retrieve this public key to verify the email's authenticity.
These records are composed of multiple tags, each indicating a specific parameter for the DKIM validation process. For instance, the p= tag specifies the public key itself, while the s= tag identifies the selector name used to locate the DKIM record in DNS. Understanding these tags is essential for maintaining strong email authentication.
Proper configuration of each tag is vital. A common issue is a DKIM body hash mismatch, which can lead to authentication failures. Ensuring every component of your DKIM record is correctly set up is a fundamental step in securing your email communications and improving deliverability.

What the 'q' tag signifies

The 'q' tag within a DKIM record specifies the query method used to retrieve the public key. In simpler terms, it tells the receiving mail server how to find the cryptographic key needed to verify the email's signature. This is a critical piece of information for the successful authentication of your messages.
While DKIM allows for other methods, the standard and almost universally used value for the 'q' tag is dns/txt. This value indicates that the public key should be retrieved from a DNS TXT record. This is clearly defined in the RFC 6376 specification for DKIM, which outlines the technical standards for DomainKeys Identified Mail.
Example DKIM record snippet with 'q' tagdns
v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDnN5wD7T... q=dns/txt;
If the 'q' tag specifies dns/txt, the receiving server constructs a query to fetch the public key record by combining the DKIM selector (s=) with the signing domain (d=). Without this clear instruction, the receiving server wouldn't know how to proceed with the critical step of key retrieval.

The verification process and the 'q' tag

Email authentication process with a key unlocking a padlock
When an email arrives at a receiving mail server, the server checks the DKIM-Signature header field. This header includes the signing domain (d=) and the selector (s=) among other details. The server then uses these values to construct a DNS query for the DKIM public key record. The 'q' tag guides this query process.
For example, if an email is signed with a selector selector1 for example.com, the receiving server will look for a TXT record at selector1._domainkey.example.com. The 'q' tag confirms that this DNS TXT lookup method is the one to use, ensuring the correct key is retrieved.

What if the 'q' tag is missing or incorrect?

While the 'q' tag is optional, modern email systems implicitly assume q=dns/txt if it's not present. However, explicitly including it is a best practice. If an incorrect value were to be used, the receiving server might fail to locate the public key, leading to a DKIM authentication failure. This can severely impact your email deliverability and could cause your emails to land in spam folders.
Without the correct public key retrieval method, DKIM cannot function as intended. This makes emails vulnerable to spoofing, where malicious actors send emails pretending to be from your domain. A robust DKIM setup, including the 'q' tag, is a foundational element of a strong email authentication strategy.

Ensuring optimal email deliverability and security

A properly configured DKIM record, with the 'q' tag explicitly set to dns/txt, contributes significantly to a positive sending reputation. When a receiving server can easily verify your email's authenticity, it builds trust, making your messages less likely to be blocked or blacklisted (blocklisted). This is vital for all types of email, from transactional messages to marketing campaigns.
Strong email authentication, including DKIM, SPF, and DMARC, acts as a robust defense against email spoofing and phishing attacks. By ensuring that your emails are digitally signed and verifiable, you protect your brand's integrity and your recipients from fraudulent messages. This security layer is increasingly important as cyber threats evolve.
To effectively manage your email authentication and ensure optimal deliverability, a reliable DMARC monitoring solution is invaluable. Suped offers an AI-powered platform that doesn't just show you data but provides actionable recommendations to fix issues and strengthen your policy. Our unified platform brings together DMARC, SPF, and DKIM monitoring with real-time alerts and deliverability insights, making DMARC accessible and effective for everyone.

Concluding thoughts

The 'q' tag in a DKIM record, though often overlooked, plays a fundamental role in the email authentication process. By specifying dns/txt as the public key query method, it ensures that receiving mail servers can successfully retrieve and use your public key to verify your emails. This seemingly small detail is part of the larger mechanism that keeps your email secure and delivered to the inbox.
A complete and correct DKIM setup is an indispensable part of your email infrastructure. Along with SPF and DMARC, it forms a crucial shield against abuse, bolstering your domain reputation and ultimately ensuring your legitimate emails reach their destination consistently.

Frequently asked questions

DMARC monitoring

Start monitoring your DMARC reports today

Suped DMARC platform dashboard

What you'll get with Suped

Real-time DMARC report monitoring and analysis
Automated alerts for authentication failures
Clear recommendations to improve email deliverability
Protection against phishing and domain spoofing
    What is the 'q' tag in a DKIM record? - DKIM - Email authentication - Knowledge base - Suped