How to set up spf dkim dmarc correctly is one of the first things to fix when messages from your business email keep going to spam. This guide shows the DirectAdmin workflow, the DNS records to check, and the tests that confirm Gmail can authenticate mail from your domain.
You can use the steps with any domain email that sends from your DirectAdmin hosting account. Replace example.com and the sample selector with your own domain and the values shown in your panel.
What you need before you start
Have these ready before changing DNS:
- Your domain name, such as
example.com. - Your DirectAdmin login and at least one working mailbox, such as
hello@example.com. - A list of every service that sends mail using your domain. This may include DirectAdmin, a website contact form, an invoicing tool, a newsletter service, or Google Workspace.
- Access to the DNS provider that hosts your authoritative nameservers.
If your domain uses HostKarle nameservers (ns1.fastnsdns.com and ns2.fastnsdns.com), start with User Level → DNS Management in DirectAdmin. If DNS is hosted somewhere else, you must publish the records at that provider. DirectAdmin can sign the message with DKIM, but the receiving server can only verify it when the public DNS record is available.
Do not delete a working SPF record before checking it. SPF allows only one SPF policy at the root of a domain. If two TXT records both start with v=spf1, receiving servers can return a permanent SPF error.
Why your email lands in spam
SPF, DKIM and DMARC solve different parts of the same trust problem:
| Record | What it proves | DNS name to check |
|---|---|---|
| SPF | Which servers are allowed to send for your domain | @ or the root domain |
| DKIM | That the sending server signed the message and the signed content was not changed | your-selector._domainkey |
| DMARC | What a receiver should do when SPF or DKIM fails, and whether the result aligns with your From: domain | _dmarc |
Google recommends email authentication for all sending domains. For bulk senders—around 5,000 or more messages to personal Gmail accounts in a 24-hour period—Google requires SPF and DKIM authentication plus a DMARC policy, and it has been increasing enforcement on non-compliant traffic. Yahoo also publishes sender guidance built around SPF, DKIM and DMARC. Read the current Gmail email sender guidelines if you send newsletters or other high-volume mail.
Authentication cannot make an unwanted message welcome. Keep your mailing list permission-based, send from a real mailbox, avoid sudden volume spikes, and use a clear unsubscribe process for promotional mail. If messages still go to spam after authentication, see how to fix emails going to the Gmail spam folder.
Step 1: List your senders and find your DNS
Why: Your records must authorise every legitimate sender, while your test must query the DNS provider that recipients actually use.
- Write down your normal mailbox sender: for example,
hello@example.com. - Check whether WordPress sends mail directly through the hosting account or through an SMTP provider. Do not add a provider to SPF until your website actually sends through it.
- List any separate service that sends as
@example.com. A service that sends from its own domain does not need to be added to your domain’s SPF just because you use it. - In your domain registrar or DNS dashboard, check the active nameservers. If they point to HostKarle, use DirectAdmin DNS Management. If they point elsewhere, make the DNS changes there.
Success looks like: you know the complete list of senders and the one DNS dashboard where the public records must be published.
Step 2: Check or add the SPF record
Why: SPF lets a receiving server compare the message’s sending server with the list authorised by your domain.
- Open DirectAdmin and go to User Level → DNS Management → your domain.
- Find the existing TXT record at the root, often shown as
@, your full domain, or a blank host field. A DirectAdmin-generated SPF value commonly resembles this:
v=spf1 a mx ip4:YOUR_MAIL_SERVER_IP ~all
- Use the exact SPF value already generated for your account if it exists. Do not replace
YOUR_MAIL_SERVER_IPwith a guessed address. The authorised value must match the server that actually sends your mail. - If you use another legitimate sender, add that provider’s official
include:or IP mechanism to the same SPF value. Keep all senders in one record. Never create a secondv=spf1TXT record. - Save the record. If your DNS is external, copy the final value to that provider instead of assuming DirectAdmin’s local zone is public.
Success looks like: one root TXT record begins with v=spf1, includes every real sender, and ends with the policy shown by your host or mail provider, such as ~all. Do not change the ending to -all until you have confirmed that every sender is included.
Step 3: Enable DKIM in DirectAdmin
Why: DKIM adds a cryptographic signature to outgoing mail so the receiver can check that the domain’s mail system signed it.
- In DirectAdmin, open User Level → Email Accounts.
- Select your domain if the panel asks you to choose one.
- Click Enable DKIM. The exact button label can vary with the DirectAdmin skin, but the feature is normally shown with the email or domain controls.
- Return to DNS Management and look for a TXT record whose name resembles
x._domainkey. The selector is the part before._domainkey; use the selector shown in your panel rather than assuming it isx. - If HostKarle manages your DNS, confirm that the DKIM TXT record was added. If another provider manages DNS, copy the complete host name and the complete TXT value there. Long DKIM keys may appear split into several quoted pieces; preserve the value exactly and do not add spaces inside the key.
The DirectAdmin documentation explains that enabling DKIM signs outgoing mail and that an external DNS zone must contain the copied public key. See its DKIM and Exim instructions if you administer a DirectAdmin server rather than only a hosting account.
Success looks like: DirectAdmin reports DKIM as enabled, a public your-selector._domainkey.example.com TXT record exists, and the selector in that record matches the selector used by your sent message.
Step 4: Add a monitoring DMARC record
Why: DMARC connects SPF or DKIM authentication to the visible From: domain and gives receivers a policy for mail that fails.
- In the same DNS dashboard, add a TXT record.
- Set the host or name to
_dmarc. Your DNS provider usually appendsexample.com, creating_dmarc.example.com. - Set the value to:
v=DMARC1; p=none
- Save the record. Start with
p=nonewhile you observe legitimate mail. It requests monitoring without telling the receiver to quarantine or reject failed messages. - Check that you have only one DMARC TXT record at
_dmarc. If you later add aggregate reporting, first create or confirm the reporting mailbox and then add a validrua=mailto:...value supplied by your mail administrator or reporting service.
DMARC passes when SPF or DKIM passes and the authenticated domain aligns with the domain in the visible From: header. For example, mail sent as hello@example.com should authenticate for example.com or an aligned subdomain. A pass for an unrelated provider domain is not enough.
Success looks like: a public _dmarc.example.com TXT record returns v=DMARC1 and contains a policy such as p=none. Google lists p=none as the minimum DMARC policy for bulk senders; you can tighten the policy after reviewing reports and fixing legitimate senders.
Step 5: Test the three records
Why: A record saved in a panel is not proof that the public DNS answer and the message headers are correct.
Check public DNS
Run these commands from a computer with dig, replacing the domain and selector:
dig +short TXT example.com
dig +short TXT x._domainkey.example.com
dig +short TXT _dmarc.example.com
You can also use Google Admin Toolbox Dig in a browser. Confirm that:
- the root query returns one SPF policy;
- the DKIM query returns the public key for the selector you enabled; and
- the DMARC query returns a record beginning with
v=DMARC1.
DNS changes can take time to appear at different resolvers. Test again later if the authoritative panel shows the record but a public query is still empty.
Check a real message
- Send a new message from your domain mailbox to a personal Gmail account. Use a simple subject and do not test with a large campaign.
- Open the message in Gmail, click the three-dot menu, and choose Show original.
- Look for the authentication summary. You want to see
SPF: PASS,DKIM: PASS, andDMARC: PASS. - Compare the authenticated domains with the
From:address. If DKIM passes for a different domain, DMARC may still fail alignment. - If you changed DNS seconds ago, send another test after propagation instead of repeatedly editing records.
Success looks like: the public DNS checks return the expected records and Gmail shows all three authentication results as PASS for a fresh message.
Troubleshooting SPF, DKIM and DMARC
SPF shows permerror
Search the root TXT results for every string beginning with v=spf1. Delete the duplicate policy only after checking that its sender mechanisms are included in the one record you keep. Also check that you have not exceeded SPF’s DNS lookup limit by adding too many nested include: mechanisms.
SPF passes but DMARC fails
SPF can pass for the envelope sender while the visible From: domain is different. Check the Return-Path and From: values in Gmail’s original message. Configure your sending service to align them, or rely on a DKIM signature whose d= domain aligns with the From: domain.
DKIM shows none or fail
Confirm that DKIM is enabled in DirectAdmin and that the selector in the message matches the public DNS name you queried. If your DNS is external, copy the key there exactly. Remove old keys only when you know they are no longer used by any sender.
DMARC shows none
DMARC: none usually means the receiver could not find a valid _dmarc record. Query _dmarc.example.com, check for a spelling error, and remove duplicate DMARC records. A policy value of p=none is valid; it is not the same as a missing DMARC record.
Everything passes but mail is still in spam
Authentication is one part of delivery. Review recipient consent, message content, sending volume, bounce rates, and the domain or IP reputation shown in Gmail Postmaster Tools. Google says it cannot guarantee inbox placement for any provider, even when authentication passes.
FAQ
Do I need SPF, DKIM and DMARC for a small business mailbox?
Yes, publish all three when you send from your own domain. Gmail’s stricter bulk-sender requirements apply at around 5,000 messages per day to personal Gmail accounts, but authentication also helps ordinary business mail prove that it came from an authorised system.
What SPF record should I use on DirectAdmin?
Use the SPF value already generated for your DirectAdmin domain, because it contains the server details for your account. A common DirectAdmin pattern includes a, mx, the sending server IP and ~all, but do not copy a sample over a working record or guess the IP.
Is p=none enough for DMARC?
It is a valid monitoring policy and the safest starting point while you identify all legitimate senders. It does not quarantine or reject failed messages. Review reports and message headers first, then ask your mail administrator whether quarantine or reject is appropriate.
Can I have more than one SPF or DMARC record?
No. Keep one SPF policy at the root and one DMARC policy at _dmarc. DKIM can have multiple selectors when different systems send mail, but each selector must have its own public key record.
How long do SPF, DKIM and DMARC changes take?
The update time depends on the record’s TTL and cached answers at different DNS resolvers. Check the public record with dig and then send a fresh test message; do not judge a new record from an old message already sitting in an inbox.
Want to partner with us, suggest a resource or advertise on this blog? Email partnerships@hostkarle.in



