How to add Static IP Address to Domain SPF Records
By CompleteInternetServices.com.au on October 18, 2025
BeginnerTo add a static IP address to your domain's SPF record, you must
update the DNS settings with your domain's registrar or hosting provider. The general process involves editing the existing SPF record to include your new IP address using the ip4 or ip6 mechanism.
Prerequisites
- The static IP address or IP range you want to authorize.
- Access to your domain's DNS management settings (usually through your domain registrar or web host).
- Your existing SPF record (if one is already configured).
Step 1: Log in to your DNS provider
Go to your domain registrar or hosting provider's website and log in to your account. This is where your DNS records are managed.
Step 2: Navigate to your DNS settings
Find the section for managing your domain's DNS records. This is often labeled "DNS Management," "Zone Editor," or "Advanced DNS."
Step 3: Locate your SPF record
Look for an existing DNS record of type TXT. The SPF record will start with v=spf1. Crucially, your domain should only have one SPF record. If you have more than one, you must merge them before adding the new IP address.
- Existing record example:
v=spf1 include:_spf.google.com ~all
Step 4: Add the IP address to the record
Edit the TXT record to include your new static IP address. The syntax depends on whether you have an IPv4 or IPv6 address. You can place the new IP address anywhere before the final ~all or -all tag.
For a single IPv4 address
Use the ip4: mechanism, followed by your IP address.
- Original:
v=spf1 include:_spf.google.com ~all - Updated:
v=spf1 ip4:203.0.113.123 include:_spf.google.com ~all
For an IPv4 address range (CIDR format)
If you need to authorize a range of addresses, use the CIDR notation.
- Original:
v=spf1 include:_spf.google.com ~all - Updated:
v=spf1 ip4:203.0.113.0/24 include:_spf.google.com ~all
For a single IPv6 address
Use the ip6: mechanism, followed by your IPv6 address.
- Original:
v=spf1 include:_spf.google.com ~all - Updated:
v=spf1 ip6:2001:db8:1234::1 include:_spf.google.com ~all
Step 5: Save your changes
After updating the TXT record with the correct syntax, save your changes.
Step 6: Wait for DNS propagation
It may take some time for your changes to propagate across the internet. This can range from a few minutes to several hours, depending on your DNS provider and the Time To Live (TTL) setting for your record.
Important considerations
- Verify your syntax: A single mistake in your SPF record can cause email delivery problems. You can use an online SPF record checker, such as the one from MxToolbox, to validate your record before and after making changes.
- Stay under the 10 lookup limit: Every
include:ormx:mechanism in your SPF record counts as a DNS lookup. The SPF standard recommends keeping the total number of lookups under 10. Exceeding this can cause receiving mail servers to fail the SPF check. - Know your enforcement level: The tag at the end of your SPF record determines how strict it is:
-all(hard fail): Rejects any emails from unauthorized senders. Use this for maximum security.~all(soft fail): Accepts emails from unauthorized senders but marks them as suspicious. Use this when you are still testing your SPF record.- Use DMARC for comprehensive protection: SPF alone is not enough to prevent all email spoofing. You should also implement DMARC, a protocol that provides more robust email authentication and reporting.
More articles on DNS