Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a public IP, say, And a private network of

When I am anywhere outside the private network, I can connect to the public IP. When I am inside the private network, I cannot communicate with the public IP (HTTP/IMAP/etc).

I am told that my DNS should resolve to the private IP from the public IP when inside the network.

Is this true, and how would I go about doing this? On server 2003 (the DNS server) I setup a reverse lookup of and created a pointer of to my private hostname. After an ipconfig /flushdns on a client, this doesn't appear to be working.

share|improve this question

DNS does not route anything – it only resolves names.

The function you are looking for is Split-horizon DNS. You can set up your DNS server to resolve the same name to different addresses, depending on where the request comes from. For example: → dnsserver:  query  '' A
dnsserver →  answer '' A → dnsserver:   query  '' A
dnsserver →   answer '' A 123.456.78.9

For Windows Server 2003, you'll probaly need a second DNS server. See these two pages for more information.

share|improve this answer
I'm quite sure this is way outside what is necessary as I said in a comment above, a simply Linsys router had everything working fine. Once it was replace with an industry grade Cisco router it no longer worked. Although this may work, I do not have a second DNS server. – Fase Aug 24 '11 at 16:32
You are wrong to be quite sure. (If you knew the right answer, you wouldn't be here asking the question, would you?) This is what is necessary. grawity is right. MaQleod has said the same thing. I say the same thing. Heck, you've told us in that self-same comment that your own network administrators have said the same thing to you. Set up the split-horizon DNS service. Your network administrators aren't providing hairpin NAT any more, and have told you to set your DNS servers to provide split-horizon service instead. So do that! – JdeBP Aug 24 '11 at 21:25

The problem you are getting is that the router does not have NAT traversal enabled. If you want to connect to your server from inside the network you will need to enable NAT traversal (if it is an option) or you will need to use the private IP. You should also be able to use an internal DNS option where an internal domain name points to that private IP.
Configuring a public DNS record to point to a private IP or hostname will not work.

share|improve this answer
Using the private IP/domain name is not an option. For example, my cell phone pulls emails from our server via the public IP, works fine. When I enter the building and connect to the building's wireless I get a private IP and can no longer retrieve email from the server's public IP. In terms of NAT traversal, I am not sure. Everything worked fine before on a Linksys, but a company has installed a Cisco router and now the public IP inside no longer works and they have told me to configure my DNS to resolve the public IP to the private IP of our server. The DNS server is on Server 2003. – Fase Aug 24 '11 at 15:34
I think asking the folks that installed and may manage the Cisco hardware would be a good start. As @MaQleod says, there is a config change needed to achieve your goal. However, the Cisco may have been configured this way intentionally to address a security issue. – Dave M Aug 24 '11 at 16:06
I have contacted them and their response was to set it up on my DNS server, which to me sounds incorrect. Provided you are using a third party DNS server it would also not work - something that wasn't the case with the Linksys router. – Fase Aug 24 '11 at 16:19
The irony, Dave M, is that the network administrators themselves probably asked the "How do I do hairpin NAT with Cisco kit?" question somewhere such as ServerFault, and got the answer that's all over the WWW: "I don't know myself. Just use split-horizon DNS instead." – JdeBP Aug 24 '11 at 22:00
up vote 1 down vote accepted

The solution was to use a hostname instead of the public IP. The hostname used for the public IP was the one assigned by the ISP. From there, I added an entry in the DNS to forward traffic to the hostname to the private IP. On the outside of the network the hostname will obviously resolve to the public IP. I was told that the reason this wasn't an issue before with the Linksys router was because Linksys has weaker security and the NAT engine allowed it. The Cisco router will not allow it due to security. It is not possible to connect to the router's public IP when behind it on a private IP.

share|improve this answer

This is how I did. My problem was I could not connect my iPhone to my internal mail server on the Wifi connection but it was connecting alright without any problme externally or on the mobile internet.

Actually the problem was that my firewall (Cisco) is not routing mail server public IP internally. The only option to achieve this was to resolve our public mail domain, e.g., to a local (private) IP instead of public IP. We are not touching external DNS entries and neither we can.

Here is what you need to do (on a Windows environment):

  1. On your DNS server, right click Forward Lookup Zone and select New Zone. With all default settings, enter the zone name as your DNS name of your server excluding the last domain, e.g. for you would enter or for, enter

  2. Inside this zone create an AA host entry, i.e. mail and IP should be your private IP, e.g. etc.

  3. This is it. Now you have to make sure your device/iPhone has a DNS name instead of a public IP, e.g. etc.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .