Exchange Connection Problems

Configure DNS and SPF for an Exchange Hybrid Deployment

Adam DavisAdam Davis Nov 27, 2026 868 views

Question details

Configure SPF and Autodiscover DNS for a hybrid Exchange deployment with on-premises and Microsoft 365 mailboxes.

Configure DNS and SPF for an Exchange Hybrid Deployment
Product
Microsoft Exchange Server and Microsoft 365
Device & OS
not provided
Scenario
An organization uses both on-premises Exchange and Microsoft 365 and needs DNS settings suited to its hybrid mail flow.
Observed behavior
SPF should authorize legitimate outbound mail sources, while Autodiscover should direct users according to the hybrid topology.
Before you start

Identify your authoritative DNS provider, the public IP addresses used for on-premises outbound mail, and any other services that send mail for the domain. Check the existing SPF and Autodiscover records and confirm your hybrid mail-flow design before changing them.

Solution 1Recommended

Configure SPF and check Autodiscover for Exchange hybrid

Use this approach to authorize outbound senders and preserve the Autodiscover endpoint required by your hybrid design.

1
Inspect the existing DNS records

In your DNS provider's management console, find the domain's TXT records and the record for autodiscover.yourdomain.com. Note any existing SPF record and the current Autodiscover target.

2
Update the SPF record

Edit the existing SPF TXT record for the sending domain so it includes every legitimate outbound source. For example, use v=spf1 ip4:SERVER-IP include:spf.protection.outlook.com -all, replacing SERVER-IP with the public IP used by an on-premises outbound server. Add an ip4 mechanism for each additional authorized IPv4 address and include any other legitimate sending services.

3
Check the Autodiscover target

In the DNS console, keep Autodiscover directed to the on-premises environment unless your documented hybrid design requires a different configuration. Review cloud-only Microsoft 365 setup instructions against your topology before changing this record.

4
Validate the published records

After DNS changes propagate, query the domain's TXT records with nslookup -type=TXT yourdomain.com and check the Autodiscover record with nslookup autodiscover.yourdomain.com. Use Microsoft Remote Connectivity Analyzer to test Outlook Autodiscover connectivity.

Configure SPF and check Autodiscover for Exchange hybrid
Check SPF before enforcing: Publish only one SPF record for each sending domain or subdomain. Use -all only after confirming that all legitimate senders are authorized; you can use ~all while monitoring during a transition. SPF evaluation is limited to 10 DNS-querying terms, so validate the complete record.
Free Microsoft Office alternative

Use WPS Office for everyday document and spreadsheet work

WPS Office is a free, lightweight alternative for working with documents, spreadsheets, and presentations. Its familiar interface and Microsoft Office format compatibility make migration straightforward. It does not configure Exchange DNS or replace Exchange mail services.

Review and document Exchange hybrid configuration in a familiar productivity suiteOpen and edit Microsoft Office formats, including DOCX, XLSX, and PPTXUse a free, lightweight suite with familiar document, spreadsheet, and presentation tools
microsoft office alternative - wps office

Frequently Asked Questions

Can I add multiple on-premises server IP addresses to SPF?

Yes. In the domain's SPF TXT record, add a separate ip4: mechanism for each authorized public IPv4 address. Keep the Microsoft 365 include and any other legitimate senders in the same SPF record.

Should I create a separate SPF record for Microsoft 365?

No. A sending domain or subdomain should have one SPF record. Add include:spf.protection.outlook.com to the existing record along with the other authorized mail sources.

Should Autodiscover point to Microsoft 365 in a hybrid deployment?

In a typical hybrid deployment, keep Autodiscover directed to the on-premises environment unless your hybrid design specifies otherwise. Check the existing DNS target and topology before following cloud-only setup instructions.

What happens if I use -all before listing every sender?

Mail from an unlisted source can fail SPF, which may affect delivery depending on the recipient's checks. Review all outbound services in your SPF TXT record before using -all; consider ~all while monitoring a transition.