How To Configure SPF (Sender Policy Framework) Records for Email Server

Posted by

For increase reputation of email server, we could adding SPF records on public DNS.

What is SPF record?

as information from this link :, an SPF record is a type of Domain Name Service (DNS) record that identifies which mail servers are permitted to send email on behalf of your domain. The purpose of an SPF record is to prevent spammers from sending messages with forged From addresses at your domain. Recipients can refer to the SPF record to determine whether a message purporting to be from your domain comes from an authorized mail server.

How to configure SPF records?

On this section, i will configure SPF records on my public DNS using cPanel. Fill of spf records is using TXT records like the following example :     IN     TXT     "v=spf1 a mx ip4: -all"

Information :

Domain could be sent from all A records,MX records on DNS and address IP include as permitted sender. Besides, not permitted.

This is the example configuration on cPanel

Select Advanced DNS Zone Editor and adding TXT records for SPF



After created SPF records on cPanel, you could check whether your SPF records has been created and has been propagation. You could check on at this link :

Please sent email to Gmail and check whether SPF records has been known or not. The following is example that the SPF records has been known on Gmail


If you has been saw mailed-by on Gmail, it’s mean you has been success to configure SPF. If no, usually still waiting for propagation of DNS

The following is example configure SPF records on GIF


Good luck and hopefully useful 😀


  1. saya sudah setting di cpanel hosting..dan tunggu untuk propagation ..saya check di hasilnya terkadang pass terkadang no published..terkadang pass spf nya..
    kenapa tidak setabil yah

  2. ini hasil cek di
    Input accepted, querying now…
    evaluating v=spf1 a mx ~all …
    Results – PermError SPF Permanent Error: No valid SPF record for included domain:
    apa artinya kang imanuddin..

    1. Hi mas Dedi,

      Untuk pengecekan SPF, yang di cek itu nama domain-nya saja. Bukan nama servernya. Jika domainnya dan nama servernya adalah, maka yang dicek adalah saja

  3. hi iman,
    I follow your guide but its not working on me, its been a week since i set on my DNS. But if I check on MXtoolbox my SPF is working but did’nt appear when i send to gmail


      1. hi iman,
        thank you, my fault.
        I already resolved the problem.. I have overlooked my configuration on firewall. I forgot that I have 2 public IP’s. the one that is configured on my mail server is not the public IP that is assigned to my rDNS..

  4. If 2 public IP from different ISP pointing to the same mail Server and acting as a failover…then what will be the SPF TEXT?

    Both the IP pointing to the same mail server (

    Please Help
    Suman Banerjee

    1. Hi,

      You could add the second IP so that like this :     IN     TXT     "v=spf1 a mx ip4: ip4: -all"
  5. Hi Iman,
    Is this correct? I need your help, how to achieve Mail Server IP Load Balancing

    Create two A records on my public DNS:

    A 222.33.456.789

    Create MX record to point to MX 10 MX 20

    Request PTR Records to my ISP:

    PTR 222.33.456.789

    Appreciate your help..

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.