Add or repair an SPF record
SPF authorises servers to send for the SMTP envelope domain. A missing or invalid policy can affect authentication and delivery.
Reviewed by Mira John Updated
Identify the sending domain
Read smtp.mailfrom in a received message’s Authentication-Results. Collect the SPF mechanisms supplied by every service that sends using that domain.
Publish one policy
Edit the TXT record beginning v=spf1 at that DNS name. Merge the required mechanisms into one policy and place the intended all mechanism last. Keep the complete SPF evaluation within the ten DNS lookup limit.
Check a fresh message
Recheck the TXT record, then send a new message to an independent mailbox. Look for spf=pass and the expected smtp.mailfrom identity.
Check the published record
Replace example.com with your domain.
nslookup -type=TXT example.com
SPF is published, but authentication still fails
More than one v=spf1 record
Multiple SPF policies at the same name produce permerror. Merge the authorised senders into one policy.
SPF fails for a different domain
Read smtp.mailfrom in the receiving system’s Authentication-Results. Query that envelope domain rather than assuming it is the visible From domain.
SPF passes, but DMARC fails
Compare the authenticated SPF domain with the visible From domain. DMARC needs an aligned SPF or DKIM pass.
Confirm: One SPF policy is published at the envelope domain, and a fresh message reports spf=pass for the intended sender.