Skip to main content

How to setup SPF record on entire server for all domains?

Comments

18 comments

  • cPanelAnthony
    Hello! As long as you choose the SPF option during the initial account creation, it should be assigned. The following thread explains how you can modify the default SPF record.
    0
  • businezz
    Hello! As long as you choose the SPF option during the initial account creation, it should be assigned. The following thread explains how you can modify the default SPF record.

    ^ Seems like this link is dead. I use WHMCS for accounts, I don't add them manually, that bothers me here, how all new account will get this SPF in their DNS.
    0
  • quietFinn
    This might work: 1st go to WHM -> Server Configuration -> Tweak Settings -> Domains -> Enable SPF on domains for newly created accounts => OFF (and SAVE) Then go to WHM -> DNS Functions -> Edit Zone Templates -> standardvirtualftp and add line: %domain%. %nsttl% IN TXT "v=spf1 a ~all" (and SAVE)
    0
  • businezz
    This might work: 1st go to WHM -> Server Configuration -> Tweak Settings -> Domains -> Enable SPF on domains for newly created accounts => OFF (and SAVE) Then go to WHM -> DNS Functions -> Edit Zone Templates -> standardvirtualftp and add line: %domain%. %nsttl% IN TXT "v=spf1 a ~all" (and SAVE)

    Will not mess up with any existing DKIM or SPF?
    0
  • quietFinn
    Will not mess up with any existing DKIM or SPF?

    No, that only affects new accounts.
    0
  • businezz
    No, that only affects new accounts.

    Thanks. I'll setup test server and see if it works.
    0
  • businezz
    Hello! As long as you choose the SPF option during the initial account creation, it should be assigned. The following thread explains how you can modify the default SPF record.

    Here's some updates on this. I created a test server with cpanel/WHM and I set hostname with valid domain name. I added 2 or 3 different domains as a new accounts and it looks like the emails are working. Some of them are going in spam, some of them straight in inbox. But, I did not add the SPF record mentioned above. Strange... ? Requested per Linode to add that record but the emails are working..
    0
  • businezz
    Will not mess up with any existing DKIM or SPF?

    This is the record I have now: v=spf1 +a +mx +ip4:xx.xx.xx.xx ~all instead "v=spf1 a ~all"
    0
  • businezz
    This might work: 1st go to WHM -> Server Configuration -> Tweak Settings -> Domains -> Enable SPF on domains for newly created accounts => OFF (and SAVE) Then go to WHM -> DNS Functions -> Edit Zone Templates -> standardvirtualftp and add line: %domain%. %nsttl% IN TXT "v=spf1 a ~all" (and SAVE)

    This is the record I have now: v=spf1 +a +mx +ip4:xx.xx.xx.xx ~all instead "v=spf1 a ~all"
    0
  • cPanelAnthony
    Here's some updates on this. I created a test server with cpanel/WHM and I set hostname with valid domain name. I added 2 or 3 different domains as a new accounts and it looks like the emails are working. Some of them are going in spam, some of them straight in inbox. But, I did not add the SPF record mentioned above. Strange... ? Requested per Linode to add that record but the emails are working..

    Your concern is that you think SPF should be needed for email to work, but you're seeing emails go through on domains without SPF set? That would be fully up to the receiving mail server. Every mail server will decide at which point it will reject an email if it doesn't contain SPF, DKIM, etc.
    0
  • businezz
    Your concern is that you think SPF should be needed for email to work, but you're seeing emails go through on domains without SPF set? That would be fully up to the receiving mail server. Every mail server will decide at which point it will reject an email if it doesn't contain SPF, DKIM, etc.

    I set a test cpanel server and I didn't touched anything on SPF records. Some emails were going through, some not, like you said the email server decides what's received. But Linode requires additional SPF record for each account: "v=spf1 a ~all" My questions was, how do I add this SPF record for all accounts, existing and new. Adding it in one by one account doesn't make sense, because I have more than 50 cpanel accounts. I guess there's no way to add additional SPF in WHM,I already contacted cPanel support. Seems like there's no solution for this.
    0
  • cPanelAnthony
    Hello again! For all future domains, you can configure DNS templates that will automatically apply the necessary records. Add DNS Record API
    0
  • businezz
    Hello again! For all future domains, you can configure DNS templates that will automatically apply the necessary records. Add DNS Record API

    I tried with templates, no luck at all...
    0
  • quietFinn
    I tested what I wrote earlier (in post #4) go to WHM -> DNS Functions -> Edit Zone Templates -> standardvirtualftp and add line: %domain%. %nsttl% IN TXT "v=spf1 a ~all" (and SAVE) Then I created an account, checked in DNS Zone Manager and the SPF record was there (guess I was lucky :rolleyes: ). You may need to edit the standard temlate also.
    0
  • businezz
    I tested what I wrote earlier (in post #4) go to WHM -> DNS Functions -> Edit Zone Templates -> standardvirtualftp and add line: %domain%. %nsttl% IN TXT "v=spf1 a ~all" (and SAVE) Then I created an account, checked in DNS Zone Manager and the SPF record was there (guess I was lucky :rolleyes: ). You may need to edit the standard temlate also.

    I'll try again. Maybe I need to reboot also
    0
  • quietFinn
    I'll try again. Maybe I need to reboot also

    No, edit the template, create an account and the record should be there.
    0
  • pintudason
    Step 1: Collect all IP addresses that are used to send email Step 2: Create your SPF record Step 3: Publish your
    0
  • quietFinn
    Step 1: Collect all IP addresses that are used to send email Step 2: Create your SPF record Step 3: Publish your
    0

Please sign in to leave a comment.