What does 'IP4 not in range' mean in an SPF failure?

You send an email, it bounces with a hard fail, and the diagnostic says "IP4 not in range." You check your SPF record, and it looks fine—so why is this happening?

It’s not a glitch. It means the server that sent your email is using an IPv4 address that isn’t listed in your domain’s SPF record. That’s a direct violation of SPF. Without authorization, the receiving server treats your email as untrusted—often rejecting it outright or marking it as spam.

This isn’t just a technicality. A single misconfigured SPF record can block all outgoing mail from your domain. We’ll walk through exactly how SPF works, why "IP4 not in range" triggers a hard fail, and how to fix it—no guesswork, no jargon. You’ll learn what to check, how to fix it, and how to prevent it from breaking again.

Key takeaways

  • SPF checks the sending server's IPv4 address against your domain’s SPF record; if the IP isn’t listed, it fails.
  • "IP4 not in range" is a hard fail—most mail servers reject the message immediately.
  • Common causes include outdated SPF records, misconfigured IP ranges, or using a third-party service without adding its IPs to SPF.

How SPF records work—and why IP4 range matters

If your email fails an SPF check because of "IP4 not in range," it means the sending server's IP address isn't listed in your domain’s SPF record, or it falls outside the specified CIDR block. SPF records use DNS TXT entries to define which IP addresses are authorized to send mail on your domain’s behalf. If your email service provider uses an IP not explicitly included or covered by a range (like /24 or /27), the check fails, and your message is likely rejected or marked as spam.

SPF mechanisms and IP4 syntax

SPF records are read from left to right and use mechanisms like ip4 to specify IPv4 addresses. For example, ip4:192.0.2.1 allows only that single IP, while ip4:192.0.2.0/24 includes all IPs from 192.0.2.0 to 192.0.2.255. The CIDR notation is critical—misconfiguring the range, even by one IP, can cause a failure. You must verify that every sending server’s IP is either listed individually or falls within one of your defined subnets.

Let’s say your email sender uses an IP like 192.0.2.123, but your SPF record only allows 192.0.2.0/25 (which covers 192.0.2.0–192.0.2.127). That’s a match. Now if the IP shifts to 192.0.2.128, it’s outside the range and triggers "not in range." This often happens when providers update infrastructure or use dynamic pools—especially with cloud services or bulk email platforms.

Why accuracy matters

An SPF record with outdated, incorrect, or overly narrow ranges leads to deliverability failures. According to the IETF’s RFC 7208, SPF is designed to prevent spoofing by validating the sending IP against published policies. If your record is too restrictive, legitimate emails get rejected. If it’s too permissive, spammers can exploit it. You need precision—not every IP that sends for you should be allowed; only the ones that actually do.

Many tools check SPF alignment, but only a few go beyond basic syntax. Validating your SPF record and testing actual sending IPs ensures you’re not missing a range. If your system uses multiple providers (like an ESP and a CRM), each IP must be accounted for. MailTester’s email checker helps you validate whether a specific sender IP aligns with your SPF—before you send. This prevents unexpected failures from reaching inboxes.

For ongoing senders, regular review is key. SPF records can break when providers add new IPs, change regions, or scale dynamically. Tools like the bulk verification feature help you audit large lists for issues like broken SPF, missing auth, or invalid domains—not just during onboarding, but after major infrastructure changes. The real-time verification API integrates into your workflow, so you catch problems before they cost you deliverability. SPF is not a one-time fix. It’s an ongoing alignment.

Why does an IP4 not in range error hurt deliverability?

If your email fails an SPF check because the sending IP isn’t in the allowed range, it’s likely to be rejected by strict mail servers like Gmail, Outlook, or Yahoo—especially if they’ve enabled authentication enforcement. Even a single failure weakens your sender reputation over time, making future messages more likely to land in spam folders or be blocked outright. Repeated failures can trigger domain-level blocklisting by anti-spam services, which hurts all outbound email from that domain.

SPF failures trigger hard bounces and damage trust

Your email server’s SPF record defines which IPs are allowed to send on your domain’s behalf. When a message comes from an IP not listed in that record—like an IP4 address outside the specified range—the receiving server treats it as potentially spoofed. Mail providers such as Google and Microsoft apply strict filtering rules: if SPF fails, the email may be rejected immediately or marked as spam. This isn’t just a technical hiccup—it’s a trust signal that the sender isn’t authorized.

Many major providers now enforce SPF as part of their authentication chain. For example, Gmail often drops messages with failing SPF checks without a second thought, especially if other signals (like domain reputation or content) are weak. Even if your message passes DKIM or DMARC, SPF remains a critical gatekeeper. The more times your domain fails SPF, the more suspicious it appears to systems like Spamhaus or Barracuda, which track sending patterns across the internet.

Reputation damage accumulates silently

Every failed SPF check adds a negative data point. ISPs don’t need a flood of failures to flag a domain—just enough to raise suspicion. Once your domain is seen as unreliable, even legitimate messages may be quarantined or routed to spam folders. This reduces inbox placement rates and hurts engagement metrics like open and click-through, which in turn further degrade sender reputation.

It’s not just about one failed message. Over time, repeated IP4 range mismatches—especially if they come from multiple sources or automated tools—signal poor infrastructure control. This is exactly why reputable tools like MailTester offer bulk email verification to catch invalid or misconfigured addresses before they’re sent. A clean list reduces the chance of sending from unlisted IPs, which helps maintain SPF integrity and sender health.

For deeper investigation, check your domain’s SPF record using RFC 7208, which outlines how SPF processing works. Regularly auditing your sending infrastructure ensures your IP ranges stay aligned with your current email operations.

How to fix an IP4 not in range SPF error: Step by step

When your email fails an SPF check due to "ip4 not in range," it means your sending server’s IP isn’t listed in your domain’s SPF record. To fix this, you must update your DNS TXT record to include the correct IP address or CIDR block using the ip4 mechanism. If you’re using a third-party email service like SendGrid or Mailchimp, use include: instead of listing IPs manually.

Step-by-step fix

  1. Log in to your domain’s DNS provider — such as Cloudflare, GoDaddy, or AWS Route 53. You need access to your domain’s DNS zone file to make changes.
  2. Find your SPF TXT record — look for a record starting with v=spf1. There should be only one valid SPF record per domain; multiple records cause validation failures.
  3. Review the current IP list — check for ip4: entries like ip4:192.0.2.1 or ip4:192.0.2.0/24. These define which IP addresses are authorized to send emails on your behalf.
  4. Identify your sending IP — the IP address of the server or service sending the email. This could be your ESP’s outbound gateway (e.g., Mailchimp’s IP range, SendGrid’s IP). You can check this directly in your ESP’s documentation or by inspecting the email’s Received header.
  5. Verify IP inclusion — ensure the sending IP is either listed directly (e.g., ip4:192.0.2.1) or falls within a CIDR range (e.g., ip4:192.0.2.0/24). If not, the SPF check fails.
  6. Add the missing IP or include a provider — if you're using a service like SendGrid or Mailchimp, use include:sendgrid.net or include:mailchimp.com instead of listing individual IPs. This is safer and more maintainable.
  7. Save the record and wait — after updating, wait 15–60 minutes for DNS propagation. SPF checks will use the new record once it’s live.

Why this matters

SPF is one of the core email authentication methods. Failure here means your message may be marked as spam or rejected outright — especially by large providers like Gmail or Outlook. You’re not just fixing a single bounce; you’re improving long-term sender reputation.

Step-by-step fixThe 7 steps described in “Step-by-step fix”, in order.1Log in to your domain’s DNS provider — such as Cloudflare, GoDaddy, orAWS Route 53. You need access to your domain’s DNS zone file to makechanges.2Find your SPF TXT record — look for a record starting with v=spf1. Thereshould be only one valid SPF record per domain; multiple records causevalidation failures.3Review the current IP list — check for ip4: entries like ip4:192.0.2.1or ip4:192.0.2.0/24. These define which IP addresses are authorized tosend emails on your behalf.4Identify your sending IP — the IP address of the server or servicesending the email. This could be your ESP’s outbound gateway (e.g.,Mailchimp’s IP range, SendGrid’s IP). You can check this directly inyour ESP’s documentation or by inspecting the email’s Received header.5Verify IP inclusion — ensure the sending IP is either listed directly(e.g., ip4:192.0.2.1) or falls within a CIDR range (e.g.,ip4:192.0.2.0/24). If not, the SPF check fails.6Add the missing IP or include a provider — if you're using a servicelike SendGrid or Mailchimp, use include:sendgrid.net orinclude:mailchimp.com instead of listing individual IPs. This is saferand more maintainable.7Save the record and wait — after updating, wait 15–60 minutes for DNSpropagation. SPF checks will use the new record once it’s live.
The 7 steps described in “Step-by-step fix”, in order.

When in doubt, verify your SPF record’s validity using free tools like MXToolbox or by checking the SPF specification (RFC 7208). These tools let you test whether your current configuration passes validation.

Even when correctly set, SPF records can break if you add too many mechanisms or exceed the 10 DNS lookup limit. Keep your records lean. If you're unsure, use a tool like MailTester’s email checker to validate delivery readiness before sending.

Common configurations that cause IP4 not in range errors

You’re seeing "IP4 not in range" errors in your SPF check because your SPF record lists IP ranges that don’t actually include the servers sending your email. This often happens when you use multiple email services without updating your SPF to include all their IPs, assume third-party services are auto-authorized, or manually add outdated IP addresses. SPF validation fails when the sending server’s IP isn’t covered, even if the rest of the record looks correct. RFC 7208 (the SPF spec) defines this clearly: only explicitly listed IPs or ranges are allowed.

Common SPF configuration pitfalls

  • Using multiple sending services (like SendGrid, Amazon SES, and your own mail server) without listing all their IP ranges in SPF — most services provide public IP lists you must manually include.
  • Assuming third-party platforms are automatically trusted — they are not. You must explicitly list their IPs using include: or ip4: mechanisms, or SPF will reject your emails.
  • Manually entering IP addresses that no longer serve your traffic — old IPs from deprecated servers can remain in records, causing range mismatches.
  • Using overly narrow CIDR blocks (like /32 or /24) that exclude new or updated IP allocations — this breaks quickly when services roll out new infrastructure.
  • Accidentally creating duplicate SPF records — when multiple TXT records exist, SPF validators may fail the check entirely, even if one record is valid.

How to avoid these misconfigurations

Let’s be honest: SPF is not set-and-forget. When you add a new sender — even one that’s been working for months — your SPF must reflect it. If you’re unsure which IPs your service uses, check their documentation or public IP lists. For example, Amazon SES and Google Analytics both publish their current sending IPs.

Mistakes in SPF configuration are a top reason emails fail deliverability checks. A single incorrect IP range exclusion can cause consistent delivery failures. Use real-time validation tools to test your SPF setup before sending. MailTester’s email checker can verify if an address is valid and help catch routing issues early, while the inbox tester helps validate deliverability across real inboxes.

Also: never assume SPF is handled for you. No email platform auto-includes itself. If you send from multiple sources, combine all their allowed IPs into one valid SPF record — and check for duplicates. You can use MxToolbox’s SPF checker for free diagnostics, but only if you understand what each line means.

When in doubt, break down your SPF into its components, verify each included range, and test with actual sending. The goal isn’t perfection — it’s consistency across all your sending infrastructure.

How to verify SPF configuration before sending

SpF checks fail when your sending IP isn’t listed in your domain’s SPF record, or when the record is malformed. To prevent this, test your SPF record in real time using tools that validate DNS from the perspective of major email providers, verify alignment with your sending IPs, and simulate inbox placement across real filters and spam engines.

Test SPF alignment with real-world receivers

Not all SPF validators check the same way. Some tools only parse DNS records locally; others simulate how Gmail, Outlook, or Yahoo actually process authentication. You need validation that reflects how receivers see your domain. Use tools that query public DNS and perform checks from the actual IP networks of major email providers. This catches errors like overly long records, duplicate mechanisms, or IPs listed outside the correct range.

For example, the SPF specification (RFC 7208) defines strict syntax rules that, if violated, cause rejection regardless of intent. A record with a syntax error — like include:example.com without proper qualification — will fail even if the IP is correct. Tools like RFC 7208 clarify the intended behavior, but real-world testing is the only way to ensure compliance.

Validate authenticity and delivery readiness

SPF is only one part of email authentication. Misconfigurations in SPF, DKIM, or DMARC can cause bounces, spam placement, or outright rejection. Even if SPF passes, your sender reputation, content, and infrastructure (like blocklists) impact delivery. Run inbox placement tests that mirror real user inboxes — filtering, spam score, and routing behavior across major providers.

MailTester’s inbox placement test evaluates SPF alignment, DKIM signature validity, DMARC policy enforcement, and sender reputation in real email environments. It shows how your message lands — in inbox, spam, or blocked — before you send to your list.

For ongoing verification, use MailTester’s verification API to check individual addresses before adding them to campaigns. This stops invalid or risky emails from being sent, preserving your sender reputation and reducing bounce rates.

What to do if you’re using a third-party email service

If you're using a third-party email service like SendGrid, Mailchimp, or HubSpot, your SPF check likely fails because you’re manually listing IP ranges that change or aren’t authorized. Instead, use the include mechanism—like include:_spf.sendgrid.net—to reference their verified SPF records. This avoids errors from outdated or incorrect IP ranges and aligns with industry standards.

Why manual IP ranges don’t work

Many providers use dynamic IP pools that rotate frequently. Manually listing individual IPs or entire ranges in your SPF record is not only impractical—it’s a common cause of SPF failures. Even if you copy a range, it might not be the one currently in use, or it could be blocked by the provider's policy.

You’re better off trusting the provider’s infrastructure. Major platforms like SendGrid and Mailchimp explicitly document how to include their SPF records. Relying on include ensures your SPF remains valid as long as their record is updated.

How to set it up correctly

Use one include statement per provider. For example, if you use both SendGrid and Mailchimp, include both include:_spf.sendgrid.net and include:servers.mcsv.net, each on its own line in the SPF record.

Don’t mix ip4 entries with includes. If you must list IPs, use only your own mail servers and keep the total entry count under 10—exceeding this limit can break SPF. The include approach is cleaner, future-proof, and widely supported by email gateways.

Always test your SPF record with tools like MxToolbox’s SPF checker or RFC 7208, which defines SPF syntax and best practices. If your setup breaks during a verification, double-check for syntax errors, extra spaces, or duplicated records.

Pro tip: Before sending mass emails, verify your list with a service like MailTester’s bulk verification tool to ensure deliverability issues aren’t caused by poor email hygiene.

SPF record limits: Why you can’t just add every IP

You can't just list every sending IP in your SPF record because SPF has a 10 DNS lookup limit. Each include, ip4, a, or mx mechanism counts as a lookup. If your record exceeds 10 lookups—common when listing individual IPs or including multiple third-party providers—the SPF check fails, even if every IP is technically valid. This is why you see “SPF record failed” errors when your IP isn’t in range.

How DNS lookups work in SPF

Every time your SPF record references another domain or resource—like include:_spf.sendgrid.net or ip4:192.0.2.1—DNS must make a separate query to resolve that entry. The limit is strict: 10 lookups maximum. Exceeding it means your SPF record fails validation, which can lead to emails being marked as spam or rejected outright.

Let’s say you’re using SendGrid, Mailchimp, AWS SES, and a custom server. If you naively list each provider’s IP with individual ip4 entries and add a and mx checks, you’ll hit the limit fast. For example, even 8 separate include directives can push you over 10, depending on how nested they are.

Use includes and CIDR blocks to stay under the limit

The best way to keep within the lookup limit is to use a single include for providers like SendGrid. One include directive triggers multiple inner lookups—but it counts as just one DNS query against your own record. That’s much more efficient than listing dozens of IPs.

If you must list IPs directly, use CIDR blocks instead of individual IP addresses. For instance, ip4:192.0.2.0/24 covers 256 IPs with a single lookup. Individual entries like ip4:192.0.2.1, ip4:192.0.2.2, etc., each require their own lookup and drain your limit quickly. Use RFC 7231 as a reference for format standards in SPF records.

Pro tip: Use MailTester’s email checker to test individual addresses before sending. It can help catch SPF-related issues early, especially when you're debugging deliverability or building new sending workflows.

SPF fails when the sending IP isn’t listed in your domain’s DNS record. MailTester’s real-time API checks that alignment before you send, flagging IP-range mismatches, misconfigured SPF, or catch-all domains that trigger bounces or spam filters. You catch the issue before delivery, not after.

Before you send: detect misconfigurations early

  • Use the real-time verification API to validate SPF alignment by checking your domain’s DNS record against the actual sending IP — no guesswork, just direct verification.
  • Run a bulk list verification to surface emails tied to invalid or risky senders, including those with malformed SPF policies or IPs outside allowed ranges.
  • Test your sender reputation and compliance with inbox placement testing, which simulates delivery across Gmail, Outlook, and Yahoo under real-world conditions.
  • Spot misconfigured SPF, DKIM, DMARC, and catch-all domains before launching campaigns — these are common causes of blocked or rejected messages.

How it works: transparency over speculation

SPF uses DNS records to list allowed IPs. If your sending IP isn’t in that list — or the record is malformed — email fails. This is a technical check, not a guess. Tools like RFC 7208 define these rules, but not every tool checks them accurately.

MailTester’s 98.9% accuracy comes from checking the actual DNS record, real-time IP validation, and analyzing delivery outcomes across real inboxes. It’s not just about syntax — it’s about whether the IP is allowed by your domain’s configuration.

For example, an IP may be technically in range, but if the SPF record is overly complex, includes invalid mechanisms, or uses a deprecated “include” directive, it still fails. MailTester detects those nuances. You don’t waste sends on addresses that will never reach inbox.

SPF, DKIM, DMARC: What each role means in email security

SPF ensures the sending server’s IP address is listed in the domain’s DNS records as an authorized sender. If the IP isn’t in the allowed range, the message fails SPF.

SPF: Sender Policy Framework

SPF validates the sending server’s IP address. If the IP isn’t within the authorized range specified in the domain’s DNS TXT record, the email is rejected or marked as suspicious.

DKIM: DomainKeys Identified Mail

DKIM adds a cryptographic signature to the email headers. Receivers verify this signature to confirm the message hasn’t been altered and that it originated from an authorized domain.

DMARC: Domain-based Message Authentication, Reporting & Conformance

DMARC tells receivers what to do if an email fails SPF or DKIM. It enforces policies and provides feedback reports, allowing domain owners to monitor and improve email authentication.

When SPF, DKIM, and DMARC are correctly configured, messages are more likely to reach inboxes. Misconfigurations — like an IP4 address outside the allowed range — trigger failures and reduce deliverability.

Authentication is not optional. It’s the foundation of sender reputation and inbox placement. One broken component can disrupt delivery across all major email providers.

Sources

Keep reading

Ready to put this into practice? MailTester verifies emails with 98.9% accuracy — start with 100 free verifications.

Frequently asked questions

Can I have multiple SPF records?

No. Having multiple SPF TXT records causes validation failure. Combine all mechanisms into a single SPF record.

Does SPF protect against phishing?

SPF helps prevent spoofing by blocking unauthorized senders, but does not stop all phishing. It must be paired with DKIM and DMARC.

Why does my email fail SPF if I use a shared service?

Shared services like shared hosting or cloud platforms often use dynamic or rotating IPs. Their IPs may not be in your SPF record unless explicitly included.

How often should I update my SPF record?

Update it whenever you start using a new sending service, change servers, or receive SPF failures during delivery.

Can I fix SPF errors without touching DNS?

No. SPF is a DNS-based check. You must update your domain’s SPF record via your DNS provider.

Does SPF affect email encryption or content?

No. SPF only validates sender legitimacy. It does not impact email encryption, formatting, or delivery timing.

Is a failed SPF check always a problem?

Yes. Even a single failed SPF check can reduce deliverability and harm long-term sender reputation.

Can MailTester test if my SPF is configured correctly?

Yes. Our inbox placement and deliverability tests verify SPF, DKIM, and DMARC alignment in real-world conditions.

What’s the difference between SPF fail and SPF softfail?

SPF fail means the IP is explicitly unauthorized. Softfail (e.g., ~all) allows the message through but flags it as suspicious.

Can I use a wildcard in my SPF record?

Using 'a' or 'mx' with wildcards is not recommended. 'ip4' and 'include' mechanisms must be specific and valid.

Why does my SPF pass in one tool but fail in another?

Different tools check different aspects. Some test only DNS syntax; others simulate real delivery and use live IP data.

Does MailTester help with DMARC policy setup?

It doesn’t configure your DMARC policy, but it tests alignment and detects policy failures during inbox placement.