Adding proper SPF Records for our Domains

Our organization uses Office 365 for our primary domain Email addresses. Let's call this domain

However, due to the daily outbound message limit imposed by 365, we've set up in-house Exchange 2003 server to handle our statement emails to our customers. These Emails are sent from Email addresses.

But we notice some Email messages (sent from in-house addresses) are bouncing back because of invalid SPF record and reverse DNS mismatch.

Reverse DNS for the IP belonging to currently still returns
This is because prior to switching over to 365, we were using our in-house Exchange server for mail services for our primary domain

I know I can call our ISP and have this updated and I'm pretty sure that this won't affect 365.
But my main concerns or question is with what should the SPF records read for both and domains to ensure that:

Our In-house Exchange server can send Emails using and Email addresses without being flagged
Emails sent to and from (365) are not affected in any way

Can you help me with some recommendation?
Who is Participating?
footechConnect With a Mentor Commented:
For your in-house Exchange, for whatever IP those emails appear to be coming from, set up an A record which points to that IP.  The name of record isn't too important, you could use one from either the "" or the "" domain, but it'll be a bit simpler to use one in "".  Then have the ISP create the PTR record for that IP which points at the same FQDN that you used for the A record.  For inbound email, you have to create an MX record for the "" domain, which will point at the same name that you used for the previously mentioned A record.

I don't know if I've seen anyone block email from a domain that doesn't have an SPF record, but a wrongly configured SPF record is another story.  Do you already have one set up for either domain?
For "" - from what I've seen the proper SPF record if sending all email from O365 is
v=spf1 –all

Open in new window

You can modify this to include the info for your in-house Exchange
v=spf1 –all

Open in new window

or if you didn't want it to rely on the SPF that you have set up for "", you could define the additional IP you're sending from manually like
v=spf1 ip4: -all

Open in new window

The SPF for "" could be something like
v=spf1 a:<FQDN> –all .  An example if the IP you're sending from has an A record called "" that points to it would be:
v=spf1 –all

Open in new window

If you wanted, instead of "-all" you could use "~all" or even "?all" in the records so that if there's a mistake it wouldn't fail the mail.
Chris HInfrastructure ManagerCommented:
May not be much help, but here's a tutorial for setting up SPF records.  Also, make sure SMTP banner matches your reverse record.
DrDave242Connect With a Mentor Commented:
The reverse DNS part is pretty simple: just make sure the PTR records and their equivalent host records match up.  So, if the host record for points to w.x.y.z, make sure the PTR record for w.x.y.z points to  Then do the same for  And you're right, the ISP is almost always the one who changes the PTR record.

SPF is a little more complex, but it's not that bad.  The purpose of SPF is to list the servers that are authorized to send mail from a particular domain.  Since you've got two e-mail domains ( and, you'll need two SPF records, one for each domain.

The record for will be pretty simple if your Exchange server is the only one sending mail from that domain.  There are several ways to configure the record to refer to your server, but if your domain has an MX record that refers to that server (i.e., if the server is used for inbound and outbound mail), your SPF record can look like this:

v=spf1 +mx -all

Open in new window

This means that only the servers specified in your domain's MX records are authorized to send mail.  Mail from your domain that gets sent by any other server will fail an SPF check.  (You can use ~all instead of -all if you want it to "softfail" instead of fail outright.  What actually happens to messages that fail or softfail is up to the receiving server.)

The record for is probably already configured, since you don't seem to be having trouble with messages sent from that domain, but you may need to add a mechanism to specify your Exchange server if you're going to use it and Office 365 to send mail from that domain.  The simplest way will probably be to refer to its public IPv4 address with the +ip4:<address> mechanism.

This is a good overview of SPF record syntax and how the various mechanisms work, if you're interested.

Also note that there are wizards on the Internet that will assist you in configuring an SPF record.  They will get the job done, but the records they generate are typically a lot more complex than they need to be.
Dave BaldwinFixer of ProblemsCommented:
The Microsoft SPF generator seems ok, it came up with the same thing I did manually.
ITDeptAtPCSAuthor Commented:
Thanks guys! Footech and DrDave provided the detailed and specific answers I was hoping to get.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.