Suppose we have a DNS entry ocean.corp.tld internally pointing to an internal IP address on our corporate network, and externally pointing to an external public IP address. Essentially same DNS name but two different IP addresses based on whether you are on our corporate network or outside of our corporate network.

If I open up https://ocean.corp.tld while connected to our corporate network, the name will be resolved to an internal IP address and it will be cached on the local machine DNS cache. Now if I try to connect to https://ocean.corp.tld from a external network from the same machine (no VPN) will it fail trying to use the cached IP address from the local machine DNS cache, or will it resolve to the external public IP address and connect successfully?


If it's still in the DNS cache then it will be resolved to the internal ip address.

Note that this would only occur if you didn't shut down and restart the client and connected from an external network. If you shut down and restarted the client before connecting from the external network then the DNS cache would be flushed and it would resolve to the external ip address.

  • so the local DNS cache gets refresh when the Windows/Linux/MacOS machine reboots? – Saqib Ali Jun 30 '14 at 22:05
  • 1
    The local DNS client cache in Windows gets flushed at shutdown. – joeqwerty Jun 30 '14 at 22:49
  • can we set a short timeout, so that the local cached IP address for ocean.corp.tld expires faster? – Saqib Ali Jun 30 '14 at 22:55
  • 1
    Sure. Set the TTL on the record to whatever you want it to be. – joeqwerty Jun 30 '14 at 22:57
  • I also learned that On Windows the cache is cleared when the IP stack is torn down. So, when you close your laptop and walk out of a WiFi range (or unplug the cable), your DNS cache goes away with the DHCP address. – Saqib Ali Jul 1 '14 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.