Add an On-Premises IPv4 Address to a Microsoft 365 SPF Record
Question details
Authorize an on-premises mail server to send email for the same domain as Microsoft 365.
- Product
- Microsoft 365 and domain DNS
- Device & OS
- not provided
- Scenario
- An organization sends email for one domain through both Microsoft 365 and an on-premises mail server.
- Observed behavior
- The domain's SPF record should authorize both Microsoft 365 and the on-premises server's public sending IPv4 address.
Identify the public IPv4 address recipients see when the on-premises server sends mail, and locate the domain's existing SPF TXT record in your DNS provider's portal. Check for any other legitimate sending services that must remain authorized.
Add the Server's Public IPv4 Address to the Existing SPF Record
Use one SPF TXT record to authorize the on-premises server and Microsoft 365 without removing other legitimate senders.
Sign in to your DNS provider's portal, select the sending domain, and open its DNS records or DNS management page.
Locate the TXT record for the sending domain whose value begins with v=spf1. Edit that record rather than adding a second SPF record for the same domain.
Add ip4: followed by the server's public sending address before the final all mechanism. For example, a record with no other senders could be: v=spf1 ip4:1.1.1.1 include:spf.protection.outlook.com -all. Replace 1.1.1.1 with your actual public address, and retain any other mechanisms needed by legitimate senders.
Save the TXT record in your DNS portal. After DNS changes propagate, query the domain's TXT records or use an SPF validation tool to confirm that one SPF record is published and its syntax is valid.

Document Your Email Configuration in WPS Office
SPF records are managed through your DNS provider, not WPS Office. For office documents, WPS Office is a free, lightweight alternative with a familiar interface and support for Microsoft Office formats, making it easy to move existing files.

Frequently Asked Questions
Will adding the on-premises IP address stop Microsoft 365 from sending mail?
It should not, as long as the existing SPF record retains include:spf.protection.outlook.com and is published correctly. Verify the saved TXT record with an SPF validation tool.
Can I create a separate SPF record for the on-premises server?
No. Publish only one SPF record for the same domain. Add the server's ip4 mechanism to the existing record in your DNS provider's portal.
Should I use the server's private or public IP address?
Use the public IPv4 address visible to receiving mail servers. If outbound mail passes through a gateway or NAT device, identify the public address used by that device.
What should I check if the updated SPF record fails validation?
Query the domain's TXT records and check for multiple SPF records, syntax errors, missing sender mechanisms, or excessive DNS lookups. SPF evaluation permits a maximum of 10 DNS-querying terms.




