SPF Record Builder
Build valid SPF records step by step
Generated SPF Record
Add Mechanism
Mechanisms (0)
Default Policy (all)
What should happen to emails that don't match any mechanism?
SPF Quick Reference
Qualifiers
- + Pass (default) - Allow the email
- - Fail - Reject the email
- ~ SoftFail - Accept but mark suspicious
- ? Neutral - No policy statement
Mechanisms
- ip4/ip6 - Match IP address or range
- a - Match A record IPs
- mx - Match MX record IPs
- include - Include another domain's SPF
- all - Match everything (used at end)
About This Tool
Build SPF (Sender Policy Framework) records to specify which mail servers are authorized to send email for your domain. This tool helps you construct valid SPF records, automatically collapses IP ranges to reduce record length, and warns when you approach the 10 DNS lookup limit.
This tool runs 100% in your browser. No data is sent to any server.
Related Tools
What is SPF?
Sender Policy Framework (SPF) is an email authentication standard (RFC 7208) that allows domain owners to specify which mail servers are authorised to send email on behalf of their domain. It works by publishing a DNS TXT record that lists the IP addresses and hostnames permitted to send mail for that domain.
When a receiving mail server gets a message claiming to be from hello@netoz.au, it checks the DNS for netoz.au's SPF record. If the sending server's IP address (such as 138.252.126.33) matches one of the authorised sources listed in the record, the message passes SPF authentication. If it doesn't match, the receiving server can reject or flag the message as suspicious.
SPF is one of the three pillars of modern email authentication, alongside DKIM (DomainKeys Identified Mail) and DMARC (Domain-based Message Authentication, Reporting and Conformance). Together, they provide a robust framework for verifying that emails genuinely come from who they claim to be from.
How SPF Prevents Email Spoofing
Email spoofing is a technique where an attacker sends emails with a forged “From” address, making it appear as though the message came from a trusted domain. Without SPF, any mail server in the world can claim to be sending on behalf of your domain — and receiving servers have no way to verify the claim.
SPF stops this by giving domain owners a way to publish an explicit list of authorised senders. Here's how the verification process works:
- An email arrives at the receiving server claiming to be from
@netoz.au - The receiving server extracts the domain from the envelope sender (Return-Path header)
- It performs a DNS TXT lookup for
netoz.auand finds the SPF record - It checks whether the connecting server's IP address is listed in the SPF record
- Based on the result (pass, fail, softfail, or neutral), the receiving server decides whether to accept, reject, or flag the message
For businesses like those hosted with NetOz, SPF is essential for protecting your brand. Without it, attackers could send phishing emails that appear to come from your domain, potentially tricking your customers, suppliers, or staff into revealing sensitive information. A properly configured SPF record makes these attacks significantly harder to pull off.
SPF also directly impacts email deliverability. Major providers like Gmail, Outlook, and Yahoo increasingly require SPF (along with DKIM and DMARC) for incoming mail. Without a valid SPF record, your legitimate emails are more likely to land in spam folders or be rejected outright.
How to Build an SPF Record
An SPF record is a DNS TXT record that starts with v=spf1 followed by a series of mechanisms and modifiers. Each mechanism specifies an authorised sending source, and the record ends with a policy for handling unauthorised senders.
Key Mechanisms
ip4:/ip6:— Authorise a specific IP address or CIDR range (e.g.ip4:138.252.126.33)include:— Include another domain's SPF record (e.g.include:_spf.google.com)a— Authorise the IP addresses in the domain's A/AAAA recordsmx— Authorise the IP addresses of the domain's MX (mail exchange) servers
Qualifiers
+(Pass) — Allow the sender (default if no qualifier is specified)-(Fail) — Reject the sender — used in-allfor a strict policy~(SoftFail) — Accept but mark as suspicious — used in~allfor a softer policy?(Neutral) — No policy — treated as if no SPF record exists
The 10 DNS Lookup Limit
SPF records are limited to 10 DNS lookups. Mechanisms like include:, a, mx, and exists each count as one lookup. Nested includes count too — if Google Workspace's _spf.google.com includes three more domains, that's four lookups total. Exceeding 10 lookups causes an SPF “permerror”, which many receivers treat as a failure. Use ip4: and ip6: where possible, as these do not count towards the limit. This builder tracks your lookup count in real time.
SPF Record Examples
Basic SPF for a Single Mail Server
If your domain only sends email from one server (e.g. NetOz's mail server at 138.252.126.33), a simple SPF record is all you need:
This authorises only that IP address and hard-fails everything else, providing the strongest protection against spoofing.
Google Workspace
If your domain uses Google Workspace for email, include Google's SPF record:
If you also send email from your own server (for example, transactional emails from your website hosted at NetOz), combine both sources:
Microsoft 365
For domains using Microsoft 365 (formerly Office 365) for email:
Microsoft recommends a hard fail (-all) policy. If you also use a marketing email service like Mailchimp alongside Microsoft 365:
Multiple Services Combined
Many businesses use several services that send email on their behalf. Here's an example combining a local mail server, Google Workspace, and a transactional email service:
Be mindful of the 10 DNS lookup limit when combining multiple include: mechanisms. Use this builder to track your lookup count and ensure your record stays valid. Once your SPF record is ready, verify it with our SPF Validator, check your MX records, or run a DNS lookup to confirm the TXT record is published correctly.