DNS lookup fails from iOS client via Mac VPN server

I am trying to help someone running a Mac OS X 10.6.8 Server and Apple's VPN server with iOS clients (e.g. an iPhone 4S running 5.1.1).


The Mac Server and iOS client can successfully connect over L2TP and by entering a numeric IP address the iOS device can access a webserver on the private network or public internet. However any attempt to use a hostname e.g. server.example.com or even a public name such as www.google.com fails. It is clear from testing that DNS lookups are failing.


The iOS device is configured to route all traffic via the VPN link, if this option is turned off then DNS lookups work. However the whole point of wanting to use a VPN setup to ensure all traffic is encrypted when using public networks so having public traffic not go via the VPN is not an option.


While we would not normally want ot use PPTP I have tested that and got the same results.


Any suggestions?

Posted on Jun 11, 2012 4:50 AM

Reply
4 replies

Jun 11, 2012 7:09 AM in response to John Lockwood

John Lockwood wrote:


It is clear from testing that DNS lookups are failing.


It shouldn't make any difference what the client device is for DNS lookups if DNS is configured correctly on the server and its name servers. If DNS lookups are failing only on certain client devices but not others then I would suspect configuration errors on the client devices. If all DNS lookups are failing then DNS is not configured correctly for the server or the server's name servers, if they are not the same.

Jun 11, 2012 6:00 PM in response to John Lockwood

Use the host command on a different Mac and see if the IP address resolves:


host 123.456.789.012


It should return a reverse lookup with the domain name:


012.789.456.123.in-addr.arpa domain name pointer some_domain.com.


If it doesn't, the name servers for the domain are not configured correctly.


If the IP address resolves correctly from a remote machine, either the VPN or the DNS on the VPN machine are not configured correctly or there is possibly a firewall configuration issue.

Aug 1, 2012 5:36 AM in response to John Lockwood

I have done more investigation and have now found the following.


While from the client devices point of view it looks like DNS lookups fail this was merely a symptom rather than the cause of failing to be able to access addresses.


It turns out the problem is that when the client device is accessing the remote internal network (which works fine) this is correctly going through the VPN servers second LAN interface which is connected to the internal LAN at the office. When the client device is accessing a public address and when the VPN is set to route all traffic via the VPN server the traffic is exiting via the VPN servers first LAN interface which is connected to the DMZ port of a firewall. This behaviour in of itself is correct but the firewall is seeing the packets as coming from an unexpected IP address, rather than looking like they are coming from the VPN server itself, they look like they are coming from a spoofed address which is actually the remote clients public IP address.


As a result the the firewall is blocking all the traffic in this case including DNS lookups.


I would at least partially consider this to be the fault of the VPN server not producing packets with correct IP addresses. I plan to try the following as possible solutions.


  1. Build a test Lion or Mountain Lion VPN server and see if it works any better.
  2. Replace the old firewall with a new one which supports OS X and iOS standard VPN client software, the current one only supports the manufacturers client, they do have a version for OS X and iOS but I want to use the standard Apple client.
  3. I could move the first LAN port of the VPN server from the DMZ to the WAN side of the firewall, the firewall then obviously would not be able to block the traffic.


Note: I am aware I could have just a single LAN connection on the VPN server on the internal LAN and setup port-forwarding in the firewall, I prefer not to do this.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

DNS lookup fails from iOS client via Mac VPN server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.