Inside our firewall at work, my machine frequently resolves to the wrong IP for some of our domains. We have a DNS server that is our primary DNS to resolve external domains to internal IP addresses (192.X.X.X instead of the public IP).
Sometimes I will get resolved to the public IP, which won't route correctly through our firewall. When this happens, I run:
ipconfig /flushdns
nslookup code.mydomain.com - I get the right DNS server and the right internal IP
ping code.mydomain.com - I get the wrong external IP address.
Firefox also resolves to the wrong IP when this is happening. This will happen intermittently throughout the day.