TXT Record

What is a TXT Record (for SPF, DKIM, DMARC)?

Last Update: August 1, 2025

Hey there, fellow web creators! If you’ve ever dived into the world of email deliverability or helped a client get their emails to actually land in inboxes, you’ve likely bumped into something called a TXT record. These little pieces of text in your domain’s DNS settings are unsung heroes. They play a massive role in email authentication, especially for SPF, DKIM, and DMARC. Understanding them is key to protecting brand reputations and making sure important emails don’t get lost in the dreaded spam folder.

DNS 101: A Super Quick Refresher

Before we dissect TXT records, let’s quickly remind ourselves what DNS is all about. It’s fundamental to how the internet works.

What is DNS (Domain Name System)?

Think of the Domain Name System (DNS) as the internet’s phonebook. Humans remember website names like www.example.com, but computers understand numerical IP addresses (like 192.0.2.1). DNS translates these human-friendly domain names into computer-friendly IP addresses. When you type a website address into your browser, your computer queries DNS servers to find the corresponding IP address and connect to the website.

Common Record Types (A, CNAME, MX, and TXT)

DNS uses various types of records to store different kinds of information about a domain. Some common ones include:

  • A Record: Maps a domain name to an IPv4 address.
  • AAAA Record: Maps a domain name to an IPv6 address.
  • CNAME Record (Canonical Name): Points a domain or subdomain to another domain name (an alias).
  • MX Record (Mail Exchange): Specifies the mail servers responsible for receiving emails on behalf of a domain.
  • And, our star for today: TXT Record.

Defining the TXT Record

Now, let’s focus specifically on the TXT record. What is it, and what does it do?

What is a TXT Record?

A TXT (Text) Record is a type of resource record in the DNS used to associate arbitrary, human-readable text with a host or other name. Originally, these records might have been used for general notes or comments about a domain. However, their flexibility has made them indispensable for various verification processes and for publishing machine-readable policy information – most notably for email authentication protocols.

Key characteristics:

  • They can hold almost any text a domain administrator wants to associate with their domain.
  • This text can be used by other systems for verification purposes (like proving domain ownership to Google Search Console) or to define policies and cryptographic keys (like SPF, DKIM, and DMARC for email).

Structure of a TXT Record

A typical TXT record has a few key components you’ll see in your DNS management interface:

  1. Host/Name: This specifies the domain or subdomain the TXT record applies to.
    • Often, @ is used to represent the root domain itself (e.g., yourdomain.com).
    • For specific services, it might be a particular subdomain, like _dmarc for DMARC records or selector._domainkey for DKIM records.
  2. Value: This is the actual text string containing the information. For email authentication, this value will be formatted according to the rules of SPF, DKIM, or DMARC.
    • Example: For an SPF record, the value might look like “v=spf1 include:sendgrid.net -all”.
  3. TTL (Time To Live): This is a number, usually in seconds, that tells DNS resolvers how long they should cache (store) this record before requesting it again. Lower TTLs mean changes propagate faster, but can increase DNS query load.

The “Why”: Why TXT Records are Essential for Email Authentication

Why do these seemingly simple text strings matter so much for email? It boils down to trust and verification.

The Problem: Email Spoofing and Phishing

Email spoofing is when a sender forges the “From” address of an email to make it appear as if it came from someone else – often a trusted brand or individual. This is a common tactic in phishing attacks, where malicious actors try to trick recipients into revealing sensitive information (like passwords or credit card details) or downloading malware. This erodes trust in email and can severely damage a brand’s reputation.

The Solution: Email Authentication Protocols (SPF, DKIM, DMARC)

To combat spoofing and phishing, several email authentication protocols were developed:

  • SPF (Sender Policy Framework): Allows domain owners to specify which mail servers are authorized to send email on behalf of their domain.
  • DKIM (DomainKeys Identified Mail): Adds a digital signature to outgoing emails, allowing receiving servers to verify that the email was actually sent by an authorized server and that its content hasn’t been tampered with in transit.
  • DMARC (Domain-based Message Authentication, Reporting & Conformance): Builds on SPF and DKIM. It allows domain owners to set a policy telling receiving mail servers what to do with emails that fail SPF or DKIM checks (e.g., quarantine them or reject them outright). DMARC also provides reporting back to the domain owner about email authentication status.

How TXT Records Bridge the Gap

So, where do TXT records fit in? They are the public publishing mechanism for these authentication protocols.

  • Domain owners publish their SPF rules, DKIM public keys, and DMARC policies as TXT records in their DNS.
  • When a receiving mail server gets an incoming email, it performs DNS lookups to retrieve the relevant TXT records for the sender’s domain.
  • It then uses the information in these TXT records to validate the email against SPF and DKIM, and then applies the DMARC policy.

Without TXT records, there would be no standardized, public way for domain owners to declare their email sending policies for other servers to check.

TXT Records for SPF (Sender Policy Framework)

Let’s look at how SPF specifically uses TXT records.

What is SPF?

SPF helps prevent sender address forgery. It allows a domain owner to specify which mail servers (identified by their IP addresses or by inclusion of other domains’ SPF records) are authorized to send email for that domain.

How SPF Uses TXT Records

  • An SPF policy is published as a TXT record at the domain (or subdomain) that emails are sent from. For example, for emails from [email protected], the SPF record would be at yourdomain.com.
  • The value of this TXT record contains the SPF rule, starting with v=spf1 followed by various mechanisms that define authorized senders.

Example SPF TXT Record Value: “v=spf1 ip4:192.0.2.1 include:_spf.google.com -all”

Key Components of an SPF Record Value

  • v=spf1: This is the version tag, indicating it’s an SPF version 1 record. It must be the first part of the record.
  • Mechanisms: These define the servers allowed to send mail. Common mechanisms include:
    • ip4:address or ip6:address: Specifies an authorized IP address or range.
    • a: Authorizes the server(s) listed in the domain’s A or AAAA records.
    • mx: Authorizes the server(s) listed in the domain’s MX records.
    • include:domain.com: Includes the SPF record of another domain (e.g., for a third-party email provider). This counts towards the DNS lookup limit.
    • exists:domain.com: Checks if a domain exists. Rarely used by typical admins.
    • all: A catch-all that always matches. Usually used at the end.
  • Qualifiers: Prefixed to mechanisms to tell the receiving server what to do if a mechanism matches.
    • + (Pass): Default. Authorized sender. (e.g., +mx)
    • – (Fail): Unauthorized. Email should be rejected. (e.g., -all)
    • ~ (SoftFail): Likely unauthorized. Email should be accepted but marked as suspicious or spam. (e.g., ~all)
    • ? (Neutral): No strong assertion. (e.g., ?all)

The -all or ~all at the end is crucial for telling servers what to do with senders not explicitly listed.

Common Pitfalls with SPF Records

  • Multiple SPF TXT records on the same domain/subdomain: A domain must have only one SPF record. Multiple records will cause validation to fail or behave unpredictably. Combine all rules into a single TXT record.
  • Exceeding the 10 DNS lookup limit: Mechanisms like include, a, mx, and redirect can trigger DNS lookups. SPF processing must not result in more than 10 such lookups.
  • Syntax errors: Incorrect formatting or typos will invalidate the record.
  • Character string limit: TXT records were traditionally limited to 255 characters per string. Longer SPF records need to be split into multiple quoted strings within the same TXT record value. Most modern DNS providers handle this, but it’s good to be aware of.

TXT Records for DKIM (DomainKeys Identified Mail)

Next up is DKIM, which uses TXT records in a different way.

What is DKIM?

DKIM provides a way to verify that an email message was indeed sent by an authorized mail server and that its content (or at least key parts of it) has not been altered in transit. It works by adding a digital cryptographic signature to the email’s headers.

How DKIM Uses TXT Records

  • The DKIM system involves a public/private key pair. The private key is kept secret on the sending mail server and is used to sign outgoing messages.
  • The corresponding public key is published in a TXT record in DNS. This TXT record is located at a specific subdomain, formed by a “selector” and _domainkey. For example: selector1._domainkey.yourdomain.com.
    • The selector is an arbitrary name chosen by the sender (e.g., s1, google, dkim2024). It allows a domain to have multiple DKIM keys for different services or rotation.
  • When a receiving mail server gets an email with a DKIM signature, it extracts the selector and domain from the signature. It then queries DNS for the TXT record at selector._domainkey.domain.com to retrieve the public key.
  • If the public key successfully verifies the signature on the email, it provides strong evidence that the email is legitimate and unaltered.

Example DKIM TXT Record Value (Conceptual and simplified for brevity): “v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD3d…” (The p= part contains the actual base64 encoded public key, which is usually very long.)

Key Components of a DKIM Record Value

  • v=DKIM1: Specifies the DKIM version. Must be present.
  • k=rsa: (Optional, default is rsa) Specifies the key type (e.g., rsa for RSA algorithm).
  • p=PUBLIC_KEY_DATA: This tag provides the actual public key data, encoded in Base64. This is the most critical part of the record. If this is empty, it means this key is revoked.
  • Other optional tags include:
    • s=: Service type (e.g., email). Not commonly used.
    • t=y: Test mode (useful during setup, tells receivers not to treat failures too harshly).
    • h=: Acceptable hash algorithms (e.g., sha256).

TXT Records for DMARC (Domain-based Message Authentication, Reporting & Conformance)

Finally, let’s look at DMARC, which builds upon SPF and DKIM.

What is DMARC?

DMARC is an email authentication, policy, and reporting protocol. It helps domain owners protect their domain from unauthorized use (spoofing) by telling receiving mail servers what to do if an email fails both SPF and DKIM checks. It also provides a way for receivers to report back to domain owners about email authentication results.

Key aspects:

  • It checks for alignment: Not only must SPF or DKIM pass, but the domain used in the “From” header must align with the domain validated by SPF or DKIM.
  • It allows domain owners to specify a policy: none (monitor only), quarantine (send to spam), or reject (block the email).
  • It enables reporting: Domain owners can receive aggregate (RUA) and forensic (RUF) reports about emails claiming to be from their domain.

How DMARC Uses TXT Records

  • A DMARC policy is published as a TXT record in DNS at the subdomain _dmarc.yourdomain.com.
  • The value of this TXT record contains various tags that define the DMARC policy and reporting preferences.

Example DMARC TXT Record Value: “v=DMARC1; p=quarantine; rua=mailto:[email protected]; pct=100; adkim=r; aspf=r”

Key Components of a DMARC Record Value

  • v=DMARC1: Specifies the DMARC version. Must be present.
  • p=POLICY: This is the requested policy for messages that fail DMARC checks. Required.
    • none: Monitor mode. Take no action, just collect reports. (Recommended to start here)
    • quarantine: Mark suspicious emails as spam or place them in a quarantine area.
    • reject: Instruct receivers to reject (bounce) the email.
  • rua=mailto:[email protected]: (Optional but highly recommended) Specifies email addresses to send aggregate DMARC reports to. Multiple addresses can be listed, comma-separated.
  • ruf=mailto:[email protected]: (Optional) Specifies email addresses for message-specific forensic (failure) reports. Due to privacy concerns and volume, these are less commonly used.
  • pct=PERCENTAGE: (Optional, default is 100) The percentage of failing messages to which the DMARC policy should be applied. Allows for gradual rollout of stricter policies.
  • sp=SUBDOMAIN_POLICY: (Optional) Policy to apply to subdomains if they don’t have their own DMARC record (e.g., sp=reject).
  • adkim=ALIGNMENT_MODE: (Optional, default is r for relaxed) Sets DKIM alignment mode.
    • r (Relaxed): The DKIM domain (d=) can be a subdomain of the “From” header domain.
    • s (Strict): The DKIM domain must exactly match the “From” header domain.
  • aspf=ALIGNMENT_MODE: (Optional, default is r for relaxed) Sets SPF alignment mode.
    • r (Relaxed): The SPF domain can be a subdomain of the “From” header domain.
    • s (Strict): The SPF domain must exactly match the “From” header domain.

Why This Matters to Web Creators and Their Clients

Understanding TXT records for email authentication isn’t just for email admins; it’s increasingly important for web creators too.

Improving Email Deliverability

This is the biggest reason.

  • When SPF, DKIM, and DMARC are correctly configured using TXT records, it significantly increases the trustworthiness of emails sent from that domain.
  • This reduces the likelihood of legitimate emails being flagged as spam or rejected by receiving mail servers.
  • This is crucial for:
    • Marketing emails and newsletters
    • Transactional emails (e.g., WooCommerce order confirmations, password resets, new user registrations sent from a WordPress site)
    • General business communications

Protecting Brand Reputation

  • These authentication methods, published via TXT records, help prevent fraudsters from spoofing your client’s domain.
  • This protects the client’s brand from being associated with phishing scams or other malicious activities, which can severely damage their reputation and customer trust.

Understanding “Emails Go to Spam” Complaints

  • When a client complains that their emails are going to spam, one of the first things to check is their domain’s SPF, DKIM, and DMARC TXT records. Missing or misconfigured records are a very common cause.

Setting Up Email Services for Clients

  • As a web creator, you might be involved in setting up new domains or configuring email services for clients.
  • You’ll need to guide them on where and how to add these TXT records in their DNS hosting provider’s control panel (e.g., GoDaddy, Cloudflare, Namecheap, etc.).

How TXT Records Work with Email Sending Platforms (like Send by Elementor)

Many businesses use third-party platforms or integrated tools to send emails. These platforms also rely on proper domain authentication.

Platform Requirements for Authentication

  • Most reputable Email Service Providers (ESPs), transactional email services, and communication toolkits require or strongly recommend that you authenticate your sending domain using SPF and DKIM.
  • This ensures that emails sent through their platform on your behalf are seen as legitimate by receiving servers.
  • Typically, the platform will provide you with specific TXT record values (or CNAME records that point to their authentication records) that you need to add to your domain’s DNS settings.
    • For SPF, this often involves adding an include:their_domain.com mechanism to your existing SPF record.
    • For DKIM, they might provide one or more selectors and corresponding TXT record values (or CNAMEs pointing to their DKIM keys).

Send by Elementor and Domain Authentication

Consider a communication toolkit designed for WordPress, like Send by Elementor. Its purpose is to empower web creators to manage and send various types of communications (like marketing emails, newsletters, or transactional emails from WooCommerce) directly from their WordPress dashboard.

  • When using a platform like Send by Elementor to dispatch emails, the underlying principles of email deliverability and authentication remain critical. For those emails to reliably reach inboxes, the sending domain must be properly authenticated.
  • While Send by Elementor focuses on simplifying the creation and dispatch of these communications from WordPress, the health of the sending domain – which includes its DNS records for SPF, DKIM, and DMARC – is a crucial factor that influences deliverability for any system sending on behalf of that domain.
  • Therefore, web creators using Send by Elementor (or any similar tool) for their clients should ensure these fundamental TXT records are correctly configured in the client’s DNS. The tool facilitates the sending process, but good domain authentication practices are essential for the success of those sends.

The Role of the Web Creator

  • Clients often turn to you, their web creator, for help with this “technical stuff.”
  • Understanding how to obtain the necessary record values from an email platform and how to guide a client (or directly assist) in adding these TXT records to their DNS manager is an increasingly valuable skill. It shows you’re not just building a website, but also considering how your client will successfully communicate from it.

Adding and Managing TXT Records: A General Guide

Adding TXT records is done through your DNS hosting provider’s interface. The exact steps vary slightly, but the general process is similar.

  1. Access DNS Management Interface:
    • Log in to the account where your domain’s DNS is hosted (e.g., GoDaddy, Namecheap, Cloudflare, your web host’s cPanel, etc.).
    • Navigate to the DNS management section or zone editor for the specific domain.
  2. Steps to Add a TXT Record:
    • Look for an option like “Add Record,” “Create Record,” or similar.
    • Select “TXT” as the record type.
    • Host/Name: Enter the hostname.
      • For SPF or a root-level DMARC record: usually @ or leave it blank (your provider’s UI will guide you – it means the root domain).
      • For DMARC: _dmarc (the provider automatically appends .yourdomain.com).
      • For DKIM: selector._domainkey (e.g., s1._domainkey or google._domainkey).
    • Value/Text/Content: Paste the exact TXT record value provided (e.g., the SPF string “v=spf1…”, the DKIM key “v=DKIM1; p=…”, or the DMARC policy “v=DMARC1; p=…”). Ensure it’s enclosed in quotes if your provider requires it, or if the value itself contains spaces. Many providers add the outer quotes automatically.
    • TTL (Time To Live): You can usually leave this at the default (e.g., 1 hour / 3600 seconds, or “Automatic”).
    • Save the record.
  3. Verifying TXT Records:
    • After adding a record, you can use online DNS lookup tools to verify it has propagated. Popular tools include:
      • MXToolbox (has specific SPF, DKIM, DMARC checkers)
      • Google Admin Toolbox (Dig tool)
      • WhatsMyDNS.net (checks propagation across multiple global servers)
  4. Propagation Time:
    • DNS changes are not always instant. It can take anywhere from a few minutes to 24-48 hours for changes to fully propagate across the global DNS system, depending on TTL settings and resolver caching. Be patient.

Common Mistakes and Troubleshooting TXT Records

Errors in TXT records can lead to authentication failures. Here are some common issues:

  • Typos: Simple typos in the Host/Name field or within the Value string are very common. Double-check every character.
  • Quotation Marks: Some DNS providers require the TXT record Value to be enclosed in double quotes, especially if it contains spaces. Others add them automatically. Check your provider’s documentation. If your SPF/DKIM/DMARC value itself has internal quotes (rare but possible), those need careful handling.
  • Character Limits for TXT Record Values: While modern DNS supports longer TXT records by splitting them into 255-character chunks within a single record, very complex SPF records or multiple DKIM keys can sometimes push limits or cause issues with older DNS software. If an SPF record is very long, ensure it’s correctly formatted as multiple quoted strings concatenated in the record value (e.g., “v=spf1 … first part” ” … second part … -all”).
  • Misunderstanding TTL and Propagation: Expecting changes to be instant can lead to frustration. Wait for the TTL to expire on old records and for changes to propagate.
  • SPF Specifics:
    • Having more than one SPF TXT record for the same domain/subdomain. You must consolidate all SPF rules into a single record.
    • Exceeding the 10 DNS lookup limit for mechanisms like include:, a:, mx:.
  • DKIM Specifics:
    • Using the wrong selector in the Host/Name field (it must match the selector used by the sending service).
    • Copying the public key (p= value) incorrectly – it’s long and precise.
  • DMARC Specifics:
    • Starting with a strict policy like p=reject too soon. Always begin with p=none and monitor reports before escalating the policy.
    • Incorrectly formatted rua or ruf email addresses.

Conclusion: TXT Records – The Unsung Heroes of Email Trust

While they might seem like obscure bits of technical data, TXT records are absolutely fundamental to the trust and security of email today.

They serve as the public bulletin board where domain owners post their critical email sending policies (SPF), cryptographic keys (DKIM), and instructions for handling unauthenticated mail (DMARC).

Properly configured TXT records for SPF, DKIM, and DMARC are no longer optional for any business serious about its email communication. They are essential for:

  • Maximizing email deliverability and avoiding the spam folder.
  • Protecting the brand’s reputation by preventing domain spoofing.

As web creators, understanding how to work with TXT records empowers you to provide more comprehensive and robust solutions for your clients. Whether you’re setting up a new domain, troubleshooting email issues, or integrating powerful email sending tools from within WordPress (like those facilitated by Send by Elementor), your knowledge of these DNS fundamentals is key. Helping clients get their TXT records right means their carefully crafted emails have the best possible chance of reaching their audience and achieving their goals. They are truly the unsung heroes that help keep email a trustworthy communication channel.

Have more questions?

Related Articles