Today I’m going to show you how to configure the DNS records of your domain, to send emails properly without ending up in spam lists like SpamRats.

If you’re a server owner, check out these spam lists and see if they’re are on one of these lists.

You need to generate a DKIM (default domain key) before you can add it to your dns zone.

 

Create the DNS records

Login to your domain registrar, e.g. GoDaddy, Hetzner or Nitrado and go to the DNS section. You should land on a section called Records. This is the place where all of your DNS records are saved. We need to add three TXT records which I will explain in the following steps.

 

Step one: The SPF record (Sender Policy Framework)

SPF is a framework that protects you against forgery of the sender address. The SPF record contains the address of the mail server from which the mail must be sent (your mail server). Add a TXT record with the following value:

"v=spf1 +a +mx -all +a:mail.yourdomain.com"

SPF TXT DNS record

You can also add the record manually to your dns zone file:

; TXT Records
@ IN TXT "v=spf1 +a +mx -all +a:mail.yourdomain.com"

 

Step two: The DMARC record

DMARC was developed to reduce abuse of emails. It works like a post, filtering incoming mails. Add a TXT record with the following value:

"v=DMARC1; p=none"

dmarc-dns-record
You can also add the record manually to your dns zone file:

; TXT Records
_dmarc IN TXT "v=DMARC1; p=none"

 

Step three: The DKIM record

DKIM (DomainKeys Identified Mail) is – similar to SPF – a mechanism that protects you against forgery of the sender address. Add a TXT record with the following value:

"v=DKIM1;k=rsa; p=your-domainykey-here;"

dkim-dns-record
You can also add the record manually to your dns zone file:

; TXT Records
default._domainkey IN TXT "v=DKIM1;k=rsa; p=your-domainykey-here;"

 

Test your configuration

A useful tool to test your DNS settings is mail-tester.com. Send a mail to the provided mail-adress and check the result. You may have to wait a few hours for the changes to take effect.

Whole TXT records section:

; TXT Records
@ IN TXT "v=spf1 +a +mx -all +a:mail.yourdomain.com"
_dmarc IN TXT "v=DMARC1; p=none"
default._domainkey IN TXT "v=DKIM1;k=rsa; p=your-domainykey-here;"