Why do the IP addresses randomly change?

I have a network with the following:

  • Cable modem with static IP address
  • Router
  • Desktop - Win 7
  • VM Host - VMware ESXi 4.0
  • A couple of VM Guests - Windows

Every now and then my Win 7 PC is unable to access some of the VMs. When I ping the VMs by their domain name their IP address shows up as the IP address of the cable modem.

Sometimes I can fix it by running ipconfig /flushdns. The IP address will reset back to what it was supposed to be, but occasionally it wont work.

Why does this happen and how can I fix it?


Update

I have had the problem happen again and so I have tried pinging the machines that are returning the public static IP address from a different machine on the network at the same time the problem is occurring. The pings were coming back with the correct addresses on the other machine. So it seems the incorrect IP address problem is only happening on the Win 7 PC.

Also, after about 10 minutes of noticing the problem, pinging the machine names that were returning incorrect IPs suddenly started working correctly again without me fiddling with anything nor running ipconfig /flushdns.


Solution 1:

I dont think it is any of the other answers so far. I would have agreed with Randolf's answer if it weren't for you saying that OTHER PC's don't experience this problem. If the VM's were registering the public IP's then all PC's would report back the public IP's

When you ping by name what name do you use? I suspect you are using the same internal DNS name as your external DNS name, something like company.com and not company.local?

Also this next bit is very important...When you ping it in the command prompt what you actually type sometimes is different to what actually it says it pings. Here is an example.

U:>ping bcdc01

Pinging bcdc01.company.local [192.168.101.1] with 3 Reply from 192.168.101.1: bytes=32 time<1ms TTL=128

Did you notice I only typed "ping bcdc01" but it said it was pinging bcdc01.company.local.

This is important for reasons I won't go into yet. Just tell me what you ping and what it says IT ACTUALLY DID ping.

You prob also have two DNS servers set in the TCP/IP properties for this machine. one is internal and the other is external. This means (in combination with the domains being the same name) sometimes it will query your internal DNS server and sometimes the external DNS server. This will resolve different IP addresses and is typical of this behavour.