Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk6 min

Which DNS Records Do You Need to Run Your Own Email Server?

A self-hosted email server needs MX and address records for inbound delivery, SPF, DKIM and DMARC for outgoing authentication, and PTR from the sending IP provider. Here’s how they fit together and what to verify.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a basic self-hosted email setup, publish an MX record and working A and/or AAAA records for its mail host; configure SPF, DKIM and DMARC for outbound authentication; and arrange a PTR (reverse-DNS) record for each public sending IP through the IP provider. The exact values come from your mail software, sending services and hosting provider—not from a universal template. These records establish routing and identity; they do not guarantee that messages reach an inbox.

Which records are needed, and what does each do?

DNS for email has two main jobs: tell other servers where to deliver incoming mail, and give receiving systems ways to check the identity of outgoing mail. Reverse DNS for the sending IP is also an important part of a self-hosted server’s identity.

As an Amazon Associate I earn from qualifying purchases.

Record Where it goes What it does
MX The email domain, such as example.com Directs senders to the host that receives mail for the domain.
A and/or AAAA The mail hostname, such as mail.example.com Resolves that hostname to the server’s IPv4 address (A), IPv6 address (AAAA), or both.
PTR Reverse DNS for each public sending IP Maps the IP address back to a hostname. The IP-address provider usually controls this record.
SPF A TXT record at the domain used by the SPF-authenticated mail identity Lists the sources authorized to send mail using that identity.
DKIM A selector-specific DNS name under the signing domain Publishes the public key receivers use to check the signature added by your mail system.
DMARC A TXT record at _dmarc.example.com Sets a policy preference for messages that fail aligned SPF and/or DKIM checks, and can request reports.

These records work together but are not interchangeable. MX and address records support delivery to your server. SPF, DKIM and DMARC address authentication; PTR links a sending IP to a hostname. The SMTP requirements for MX and its target are set out in RFC 5321. Practical summaries of email authentication and DNS setup are available from Cloudflare.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do you configure inbound mail?

1. Give the mail host a usable address

Choose a hostname such as mail.example.com and publish an A record for its IPv4 address, an AAAA record for its IPv6 address, or both. Publish only address families the server actually supports. If you publish an AAAA record, the host must be reachable over IPv6; working routing, firewall rules and reverse DNS are also needed for dependable IPv6 sending.

An MX target needs to resolve to at least one A or AAAA record. Use the hostname directly as the target rather than relying on a CNAME: RFC 5321 requires an address record when an MX target is queried and does not define CNAMEs at the target as a substitute.

2. Point the domain’s MX record to that host

Add an MX record for the domain, with the mail hostname as its target. If you publish more than one MX record, the lower preference number is tried first. Use multiple destinations only when you operate or have contracted for multiple receiving hosts; several MX entries that lead to the same unavailable infrastructure do not provide meaningful redundancy.

SMTP has an implicit fallback to the domain itself when no MX record exists, but a deliberate setup should publish the intended MX record and ensure its target resolves correctly. Do not assume that an A record on the root domain is a substitute for explicitly configuring your mail route.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What do you need for outgoing mail?

PTR: ask the IP provider to configure reverse DNS

A PTR record maps a public IP address back to a hostname. The provider that assigned the IP usually controls its reverse-DNS zone, so adding records in your ordinary forward DNS panel may not be enough. Ask the IP provider to set the PTR for each public sending IP to your mail hostname, then make sure that hostname’s A or AAAA record points forward to the relevant address. This matching relationship is often called forward-confirmed reverse DNS.

Check before choosing a host that it permits the SMTP traffic you need and gives you control over reverse DNS. A DNS change cannot overcome a hosting provider’s port restrictions or lack of PTR control. Google Cloud DNS describes the provider-controlled reverse-lookup arrangement in its reverse DNS documentation.

SPF: authorize the sources that actually send

SPF is published in a TXT record. Its policy should cover every source that sends using the relevant SPF identity, such as your server and any outbound relay you configure. Determine the exact contents from those services; a copied generic policy can omit legitimate senders or authorize sources you do not use.

Publish only one SPF record for a given owner name. RFC 7208 says multiple SPF records are not permitted for the same owner name. If you need to include another sending source, combine it into the existing policy rather than creating a second SPF TXT record. The standard is RFC 7208.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a TXT record whose value begins with v=spf1. Do not create the deprecated DNS resource-record type named SPF; Google Cloud DNS advises using TXT strings for SPF policies in its supported record types documentation.

DKIM: publish the key generated by your mail system

DKIM lets your mail system sign outgoing messages with a domain identity. Publish the corresponding public key in DNS at the selector-specific name supplied by the mail software or service; the private key stays with the signing system. The selector and record value are deployment-specific, so there is no safe universal DKIM key or record name to copy.

DMARC: set a policy at the required name

Create a TXT record at _dmarc.example.com, replacing the example domain with yours. DMARC checks whether SPF and/or DKIM authentication aligns with the domain visible to the recipient, then communicates your preferred handling for messages that fail those checks. It can also request aggregate reports.

Choose a policy that fits your readiness to identify and cover all legitimate sending sources. A policy intended to monitor results differs from one asking receivers to quarantine or reject failures. Review authentication results and any reports you receive before tightening enforcement. Cloudflare’s DMARC guidance explains the record’s role; the protocol is specified in RFC 7489.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In what order should you set up the records?

  1. Confirm provider capabilities. Choose a mail host that permits required inbound and outbound SMTP traffic and lets you arrange reverse DNS for the public sending IP.
  2. Configure the mail hostname. Publish its A and/or AAAA record for the address families your server actually supports. Request the corresponding PTR from the IP provider.
  3. Route incoming mail. Publish the domain’s MX record pointing to the mail hostname, then confirm that the MX target resolves to an address record.
  4. Authorize outgoing sources. Configure one SPF TXT policy for the relevant identity, including all actual sending sources.
  5. Enable DKIM signing. Generate or obtain the key and selector from your mail software or service, publish the public key, and configure the system to sign outgoing mail.
  6. Publish DMARC. Add the TXT record at _dmarc and choose a monitoring or enforcement policy appropriate to your confidence that legitimate sources are covered.
  7. Test the setup. Check DNS answers, SMTP connectivity, authentication results and delivery to accounts you control. A successful DNS lookup alone does not establish inbox placement.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Do you need extra MX records, IPv6, or other DNS features?

  • Multiple MX hosts: Optional. They help with failover only when the hosts are independently available and correctly configured. Consider whether a secondary server can queue or store mail during an outage.
  • AAAA: Optional if your server does not offer working IPv6 SMTP. If you publish one, make sure IPv6 routing, firewall access and reverse DNS are configured for it.
  • Client auto-configuration, MTA-STS, TLS reporting and DNSSEC: These can be useful in particular deployments, but they are not universal minimum records for basic SMTP routing and authentication. Their configuration depends on your mail software, DNS host and operational requirements.

Will these records make your mail land in the inbox?

No DNS checklist can guarantee inbox placement. Authentication helps receiving systems assess whether messages are associated with authorized identities and whether those identities align with the visible author domain; it does not control the recipient’s filtering decision. Hosting restrictions, IP history and reputation, message characteristics, and each recipient’s filtering rules also matter. Check the current sending policies of your host and any relay you use.

Best Value
Sale
Mastering Active Directory: Design, deploy, and protect Active Directory Domain Services for Windows Server 2022
  • Mastering Active Directory: Design, deploy, and protect Active Directory Domain Services for Windows Server 2022, 3rd Edition
  • ABIS BOOK
  • Packt Publishing

Direct sending means your server connects to recipient mail servers; an SMTP relay adds an external sending service and its own SPF and DKIM requirements. A relay may change the configuration and provider dependencies, but neither option makes delivery “legit” by itself. If you use one, incorporate its instructions into your authentication setup and verify the resulting messages.

For a self-hosted domain, DNS is one part of a working mail system. The mail software and providers supply the exact values; the DNS records publish routing and authentication information, while the IP provider controls reverse DNS for the sending address.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.