Why do the IP addresses randomly change?

7

1

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.

GiddyUpHorsey

Posted 2011-02-21T06:46:18.537

Reputation: 551

Just to be clear, your cable modem has a static public IP and when the problem occurs, the VM names resolve to that public IP instead of the proper private IP? – Stephen Jennings – 2011-02-21T07:00:44.533

That's correct. – GiddyUpHorsey – 2011-02-21T22:59:51.423

I would run a packet capture program like Wireshark to confirm to what server and what hosts the windows 7 system is looking up. – Kyle Smith – 2011-05-18T14:53:24.783

Answers

2

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.

Mucker

Posted 2011-02-21T06:46:18.537

Reputation: 787

Did this fix it? – Mucker – 2012-04-15T01:07:18.470

0

Your VMs that are getting public IP assignments are probably set to use a NIC that's directly hooked up to the public side. Or if you only have one NIC, then your firewall may not be providing NAT.

Randolf Richardson

Posted 2011-02-21T06:46:18.537

Reputation: 14 002

I'm not sure that it's the VMs getting assigned the public ip address because the ip addresses (192.168.0.xxx) appear correct when pinged from another machine on the network. The wrong ip addresses only occur when pinged from the Win 7 PC, which makes me think that the problem is only with that machine. I'm just not sure how to test/fix it. – GiddyUpHorsey – 2011-03-05T14:14:16.283

0

What do you mean when you say "domain name"? It's important to understand whether these domain names are internal to your network, vs whether you've tried to assign public-facing hostnames to your VMs.

  1. Something to check: your VMs may be set to use NAT rather than bridged networking - try switching them to bridged (bridged to the adapter connected to the network, of course) and they should be assigned internal IPs just like your real machines hooked up to the router.
  2. The public IP of your VMs will always be the IP of the cable modem, since that's the only IP that the rest of the world can see - you could forward ports on the router in to the equivalent port on the VM if you want to run any public facing network services using the VM.
  3. From inside the network, each of the hosts should have their own internal IP address, as well as an internal hostname (with a decent router). I think it's likely either a problem with the way that the Win 7 PC is resolving hostnames, or with the way that you expect hostnames to be resolved.

Dawngerpony

Posted 2011-02-21T06:46:18.537

Reputation: 363

By "domain name" I mean the machine name that is registered on the DNS server which is itself on a VM. Under VMware Server I was able to configure the networking for NAT, bridged etc but I can't find the equivalent on ESXi. So I'm using whatever the default happens to be. – GiddyUpHorsey – 2011-04-25T05:31:01.010