How to create SPF records for your domain
How to create SPF records for emails
Email reliability is something every user, every business owner wants to have. But what they don’t know is what can they do to have a reliable send policy. Here is where the SPF (sender policy framework) records come in. A SPF record is a type of DNS record that identifies which mail server is allowed to send emails on behalf of the specific domain name. So back to the main topic, how to create SPF records for your own custom domain names.
Creating the SPF Record for your domain
This is not really that hard, mainly you just need to create a normal txt record in your DNS records and specify the servers that are allowed to send emails using your domain name.
I found a nice little tool online for those that don’t really know how to create this on-the-fly, (I also used this as its a lot faster then doing it manually), you can check this here:
The result should something similar to bellow:
A bit of explanation I believe its in order:
1 |
yourhowto.net. IN TXT "v=spf1 mx a ip4:31.22.7.50 ~all" |
First as you can see its the domain name that you want to create the SPF record for, next is the type of the DNS record which is TXT, after this comes the value of the TXT record.
The values specify that you allow the MX servers (mx) to send mails for your domain, same for the IP address of the domain (a) and then you manually specify an additional IP address (ip4:31.22.7.50).
Lastly is the strictness of the emails being sent, I choose to accept emails but mark them.
Next you would need to copy the value generated and add it to your DNS server for your domain name, if you do not know how to do this, contact your hosting provider for them to add it for you.
End result when queering the domain settings
I’ll show you a test to see how TXT records are, these should look something similar based on the settings you used:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
:~$ dig txt yourhowto.net ; < <>> DiG 9.8.1-P1 < <>> txt yourhowto.net ;; global options: +cmd ;; Got answer: ;; ->>HEADER< <- opcode: QUERY, status: NOERROR, id: 16569 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0 ;; QUESTION SECTION: ;yourhowto.net. IN TXT ;; ANSWER SECTION: yourhowto.net. 200 IN TXT " v=spf1 +ip4:31.22.7.50 +a +mx +ip4:31.22.7.51 ?all" ;; AUTHORITY SECTION: yourhowto.net. 169108 IN NS ns2.yourhowto.net. yourhowto.net. 169108 IN NS ns1.yourhowto.net. ;; Query time: 64 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Wed Jul 31 20:41:46 2013 ;; MSG SIZE rcvd: 151 |
You would also see a nice message in your source emails stating that you are permitting the mail server to send emails. Se bellow image:
You should see something similar to the message above for your domain name. And that’s about it, chears!