SPF and DKIM are email records that help receiving mail servers trust your messages. This guide shows DirectAdmin users how to add or check both records, and where to find them in the panel.
If your emails land in spam or junk folders, missing or incorrect SPF and DKIM records are a common cause. For an explanation of what SPF, DKIM and DMARC do, read Why Are My Emails Going to Spam? SPF, DKIM and DMARC Explained.
Set Up SPF in DirectAdmin
SPF (Sender Policy Framework) is a DNS TXT record that lists the servers allowed to send email for your domain.
- Log in to DirectAdmin.
- Under Domain Settings, click DNS Management.
- Select your domain.
- Look for an existing TXT record whose value starts with
v=spf1. - If one exists, edit it. If not, click Add Record.
- Set the record type to TXT.
- Set the Name field to
@, which represents your root domain. - Set the Value to the SPF record for your email setup. The example below is generic. Replace it with the value your email provider gives you.
- Click Save.
Example value (generic, do not copy as-is):
v=spf1 a mx ~all
You can only have one SPF record per domain. If you use another sending service, add its include details to the same record rather than creating a second one.
Set Up DKIM in DirectAdmin
DKIM (DomainKeys Identified Mail) adds a digital signature to your outgoing email. Receiving servers use it to check that the message really came from your domain.
- Log in to DirectAdmin.
- Go to E-Mail Manager, or search for "DKIM" in the DirectAdmin search bar.
- Look for DKIM options for your domain.
- If DKIM is not enabled, click Enable DKIM next to your domain.
- Go to DNS Management and find a TXT record named
default._domainkey. Its presence means DKIM is published.
The menu labels can differ between DirectAdmin versions and skins. If you cannot find the DKIM option, see the troubleshooting section below.
If your DNS is hosted elsewhere
Enabling DKIM in DirectAdmin only updates the DNS zone that DirectAdmin manages. If your domain's DNS is managed by another provider, copy the DKIM and SPF TXT records from the DNS Management page and add them to that provider.
Set Up DMARC in DirectAdmin
DMARC (Domain-based Message Authentication, Reporting and Conformance) tells receiving servers what to do when a message fails SPF or DKIM. It can also send you reports.
- In DirectAdmin, go to DNS Management.
- Click Add Record.
- Set the type to TXT.
- Set the Name to
_dmarc. - Set the Value to the example below, replacing the address with your own email address:
v=DMARC1; p=none; rua=mailto:your-email-address
- Click Save.
The p=none setting means monitor only. No email is blocked. After you confirm that your legitimate email passes SPF and DKIM, you can change this to p=quarantine or p=reject. Leave at least 1 to 2 weeks between changes.
Check Your Records and Test
DNS changes can take anywhere from 15 minutes to 24 hours to take effect. After a few hours, check the records with a DNS lookup tool, then send a test email to an external address or to a checker such as mail-tester.com. Review the authentication results it shows.
Troubleshooting
"Multiple SPF records found" warning
Each domain can have only one SPF record. Edit the existing record and merge any extra details into it. Multiple SPF records cause failures.
DKIM option is not visible
DKIM may need to be enabled on the server first. This is not something you can change yourself on shared hosting. Contact support using live chat at my.hostking.host or open a support ticket from the client area.
Records added but DKIM or SPF still fail
Check that the records are in the DNS zone that is actually live for your domain. If you disabled and re-enabled DKIM after a DNS change, check the DKIM TXT record again.
Emails still go to spam
Other factors can affect delivery, including email content and the reputation of the sending server. Run a test with mail-tester.com for a detailed breakdown.
Get Help
Live chat is available on the Hostking website every day from 05:00 to 20:00 UTC. You can also open a support ticket from the Hostking client area.
