Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Spaces in "unquoted" SPF record may invalidate SPF record
New on LowEndTalk? Please Register and read our Community Rules.

Spaces in "unquoted" SPF record may invalidate SPF record

loydloyd Member
edited February 2016 in Tutorials

Not sure if this is only problem with some DNS user interfaces or its more general. I thought I had SPF record for years only to find I did not. Well I did have it so it was passing shallow checks, but the syntax of it was ignored.

I noticed gmail marks my emails as SPF neutral despite having SPF record:

v=spf1 a mx -all

Also MX toolbox failed my record, but it was passing fine on

Checked what exactly is DNS returning

nslookup -q=txt

and the result was this:

text = "v=spf1" "a" "mx" "-all"

Those quotes should not be there. Rewrote the SPF record without spaces using the optional + to


Waited 10-15 minutes and then nslookup returned

text = "v=spf1+a+mx-all"

MX toolbox is happy now, and test email to gmail gains spf-pass.

UPDATE: as TheLinuxBug points out below, turns out we are supposed to place entire SPF record in quotes and then you can use spaces in it.


  • TheLinuxBugTheLinuxBug Member
    edited February 2016

    @loyd When you set the txt record, you should have it in "" when you enter the content. It looks like when you originally set this you didn't set it in "" so it set each piece of information included as its own object, thus why you saw "v=spf1" "a" "mx" "-all". It sounds like the system you were using interpreted it without quotes but smashed together and then added the quotes for you.


    You need to put "" around anything that is a text record or it will get sliced up like you saw. So the correct record would actually be "v=spf1 +a +mx -all" and it would work just the same.

    my 2 cents.


    Thanked by 2loyd tehdan
  • loydloyd Member
    edited February 2016

    @TheLinuxBug said:

    That makes sense, good to know. Thank you

    I will update the subject

  • Btw if you are using cloudflare it automatically quotes all txt records.

  • loydloyd Member
    edited February 2016

    On another DNS zone manager when using quotes, it changed them to " Next time I saved, it changed it to " ... Some want quotes, some dont.

Sign In or Register to comment.