Can't add SPF value to DNS setting, "Invalid" it says

I’m setting up netlify DNS, trying to set up my email, and the one record I can’t add is the SPF record because the values are considered invalid.

So for example,
I can’t add a TXT with value v=spf1 include:spf.migadu.com -all
I can’t add an SPF with value v=spf1 include:spf.migadu.com -all

The error I receive is as follows:
dns_api mydomain - mydomain/TXT: 400 - “[v=spf1 include:spf.migadu.com -all]” is invalid for “TXT” record type

and

dns_api mydomain - mydomain/SPF: 400 - “[v=spf1 include:spf.migadu.com -all]” is invalid for “SPF” record type

My mailservers instruct me to use TXT, but I tried both, and netlify dns will not accept either.

This didn’t used to be the case, I still have domains where I was able to add the proper records

Hi @respawn :wave:t6: welcome to the forums!

Thanks so much for reaching out. First, have you looked through this resource 7 It is a compilation of common DNS set up and troubleshoot questions. This will be a good starting point.

If those resources don’t get you on the right track, can you share a bit more information about what you are trying to accomplish?

Lastly, please share these additional details so we can look into your experience further:

  • what you have already tried
  • any error messages you have received in your terminal window or in the developer console

Thanks so much!

Hey Sam,

I’m just trying to set up the records for email.

The form for entering those values for the SPF won’t accept this as a value
v=spf1 include:spf.migadu.com -all

That’s all I need applied to a TXT record in order for my email to start working, it’s a problem with the netlify dns interface.

I think some of the characters, maybe the = or the - or both are being rejected. This always used to work in the past before the netlify dns form was changed.

so how do I apply the following as a value inside a TXT record to my domain?
v=spf1 include:spf.migadu.com -all

So the issue was that I was pasting the value into the input, this somehow invalidated it or had hidden characters.

Typing it out manually solve the problem.

Hi @respawn, thanks for providing that information. Glad to hear you were able to solve this issue on your own! Please let us know if you have any other questions or concerns.