iPhone and Exchange - push and DNS
July 18th, 2008 by gregr
It seems lot of folks are having problems getting Exchange push email working reliably with the new iPhone 2.0 software. For me, it worked flawlessly when I was outside of the office, but when I was in the office and connected to our corporate LAN via wi-fi, it was unreliable at best. If I instead connected to another wi-fi network (like the guest network from the folks two floors below us), everything worked fine.
There is an Apple KB article talking about this:
When roaming between home and office networks with Wi-Fi enabled, “push” may stop working if your company’s Exchange ActiveSync server has a different IP address for intranet and Internet clients. Make sure the DNS for your network returns a single, externally-routable address to the Exchange ActiveSync server for both intranet and Internet clients. This is required so the device can use the same IP address for communicating with the server when both types of connections are active. A workaround to avoid this issue is to disable Wi-Fi on the iPhone.
Yep, that sounded like the problem. Our internal and external DNS for our corporate mail server is different, just as the article surmised. But it turns out in our case, it was non-trivial to change them to be the same thing.
But it turns out there is a workaround that works for me. If you go into Settings / Wi-Fi, find your wi-fi network, and click the blue button next to it, you’ll see something like the following:

And here’s the tricky part. Tap on the “DNS” setting, and edit it. In my case, rather than using the internal DHCP-assigned DNS servers, I typed in two external DNS servers. These new servers will override whatever is returned from DHCP, and when asked for the IP of our mail server, they will return the externally-facing IP, since that’s all they know about.
And that was it! The push email is now working 100% reliably. A little too reliably, actually. :-)
Note - I obviously no longer have internal DNS resolution within my corporate LAN, but that’s not a problem for me. Your mileage may vary.
Note 2 - this also assumes your external mail server IP is accessible from your LAN. This may or may not be the case, depending on how your firewalls and the rest of your network are configured.
This entry was posted on Friday, July 18th, 2008 at 1:55 pm and is filed under apple, internet, iphone. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

July 19th, 2008 at 7:57 pm
An alternate approach that may work for many (it does for us at the Denver Art Museum) is to simply point the iPhone at the external IP address / host name for Outlook Web Access. True, on the internal LAN you’re going to take a trip outside to get to the internal server, but it should always work.
July 31st, 2008 at 11:11 am
My exchange activesync is not pushing. I’m using the gen 1 iPhone but have the new softward. Is push for exchange only supported while on wifi or does it work via Edge as well? I have yet to see it actually push anything, it doesn’t update until I actually open mail or contacts or calendar etc.
July 31st, 2008 at 11:16 am
@Rob - it definitely works over edge…sounds like there might be some config problems on your Exchange Server?
September 9th, 2008 at 8:49 pm
On the Windows server:
Start > Program Files > Administrative Tools > DNS
Right click on Forward Lookup Zones and choose New Zone
Click Next, leave Primary Zone selected and click Next
Leave “To all domain controllers…..” and click Next
In “Zone Name”, type your mail server (ie: mail.domainname.com) and click Next
Leave “Allow only secure…..” and click Next
Click Finish
In the Forward Lookup Zones pane on the right, double click the new zone and then right click in the empty area and choose New Host (A)
Leave the name blank and enter the IP address of your internal mail server (ie: 192.168.1.xxx) and select create PTR record, then Add Host
Click Start > Run, type CMD and in then type ipconfig /flushdns
That should be it…
September 9th, 2008 at 8:54 pm
@MacITSolutions - I don’t think that will get around the problem of having different IPs for internal and external networks.
October 24th, 2008 at 10:30 am
Just stumbled across this discussion. Bruce’s original suggestion worked for us perfectly.
Overriding the DNS on the WIFI setting to point to an external DNS server solves it. Thanks!