Ping by Name Returns Wrong IP Address


I have a few machines that when I ping them they ping back with the wrong IP address.  I have done an ipconfig /flushdns on them, but still they will not ping with the right address.  I have checked the IP address on the DHCP server and it is correct with what is on the machine.

We were a small company with our own domain we got bought out by a bigger company with its own domain.  For this example I will use Domain A for our old small domain and Domain B for the company that bought us out domain.
So right now all our computers are on Domain B.  All the network configuration (DHCP, Gateway, Domain, and DNS) all come from Domain A.  The only network configurations we have from Domain B is a few DNS suffixes that get pushed down via Group Policy.  When I look in the Forward Lookup Zone on Domain A under Domain A’s domain I don’t see any of our computers that are on Domain B even though I’m pushing down DNS setting from Domain A.  I do see in the Reverse Lookup Zone all the computers on Domain B and they all seem to have a PTR record.
The only reason we have Domain A is because the bigger company will not let us move our servers over to Domain B.  
I guess my questions is could the problem that we are seeing be caused by us not pushing down network configurations for Domain B?  If we configured our Domain and DNS to reflect Domain B instead of Domain A would that fix the problem with DNS that we are seeing?

We don’t have any admin access to Domain B.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:
Check the following as well:

%windir%\system32\drivers\etc\hosts   & lmhosts.sam

(double click and open with notepad)
ensure there are no definitions in there.

run an ipconfig /all

see what the default gateway is
go to that machine, and clear the dns cache on the gateway.

Is there anything similiar between all the machines that are reporting the wrong IP?
Does the same happen when you ping with fully qualified domain name?
Idea is that you have the same names in Domain A and Domain B but the search suffix wrong.
All this is related to name resolution.

I don't understand what you mean by "ping back with the wrong address".
A ping is ISSUED by a certain host. The host runs the usual process to resolve the destination machine name into an IP address. When it knows the IP address, it sends the "ping message" (ICMP ECHO REQUEST) to tje destination machine.

On the machine that you ran a "ping" that did not reach the correct ip address, run an nslookup command
if you have previously run
ping machine1
nslookup machine1

if you have previously run
ping machine1.domainA.loc
nslookup machine1.domainA.loc


You will see which DNS answered, and with what IP address.

Now, it may be that the name resolution is not done with DNS but with WINS or even with broadcast. Normally, if you use an fqdn name (machine1.domainA.loc), DNS should be used first.

Now, let it be clear that in case a ping command seems to be reaching a wrong IP address, the problem is within the host that SENT the ping command, not with the host that you thought should have answered.

Check these resources:

Use nslookup, nbtstat (nbtstat -c displays the netbios cache) and ipconfig /displaydns utility to check what happens on your machines
Webinar: What were the top threats in Q2 2018?

Every quarter, the WatchGuard Threat Lab releases an Internet Security Report that describes and analyzes the top threat trends impacting companies around the world. Are you ready to learn more about the top threats of Q2 2018? Register for our Sept. 26th webinar to learn more!

eServAuthor Commented:
Checked the hosts and lnhosts.sam and those all look good.
The gateway is pointed to our Cisco Router - Sorry my router knowledge is not that good.  Could the router have cached that IP with that computer name?  This has been going on for about 3 months now I would have thought it would have flushed out.
The only thing the same on all the machines is the image, but I have other machines that when I ping them give me the correct IP address.

Yes, when I ping the fully qualified domain name I get the wrong IP address.

What I mean when I say ping back with the wrong address when I ping machine1 it gives me the IP address of another computer.  Example machine1 (X.X.X.79) machine2 (X.X.X.86).  When I ping machine1 from any computer on our network I get X.X.X.86 which is the IP Address of machine2.  In DHCP I see the correct IP address for machine1 and machine2.
Here is what I get when I do an nslookup
> Machine1
Server:  DC on Domain A
Address:  X.X.X.65

Non-authoritative answer:
Name:    Machine1.domainB.loc
Addresses:  IPV6 Address

> Machine1.domainB.loc
Server:  DC on Domain A
Address:  X.X.X.65

DNS request timed out.
    timeout was 2 seconds.
Non-authoritative answer:
Name:    Machine1.domainB.local
Addresses:  IPV6 Address
When I do a ipconfig /displydns from another computer on the network.   I see that computer that I’m having issues with and it has the wrong IP address along with a few other servers in the company.
Record Name . . . . . : Machine1.domainB.loc
Record Type . . . . . : 1
Time To Live  . . . . : 124
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : X.X.X.86

Record Name . . . . . : Machine1.domainB.loc
Record Type . . . . . : 28
Time To Live  . . . . : 125
Data Length . . . . . : 16
Section . . . . . . . : Answer
AAAA Record . . . . . : IPV6 Address
Is there a static entry in your DNS (x.x.x.65) for Machine1 (that would have the wrong IP address)?
Your machines are using this very DNS for name resolution, so there may be an issue on the zones of that DNS...
If you do have a local DNS (and you certainly have, a DC for Dmain B is a DNS), use it for name resolution:
lserver <DC for Domain B>

This name should be correctly resolved

You should also make sure that your clients get a DC for domain B as their first DNS (which seems not to be the case, since they are using a DC for domain A).
Configure your DHCP accordingly.
eServAuthor Commented:

Thanks for getting back to me so quick.  I don’t have any static DNS on machine1 it is getting X.X.X.65 from the DHCP scope.  This is what I thought was the issue.  When we moved our computers to DomainB we never updated our DHCP scope to reflect this.  We kept everything as if our computers still connected to DomianA which I think is causing this problems.   Will it take a few days after I make the change to the DHCP scope to work things out, or should we see results in a few hours?
I did not imply "static DNS in DomainB's machines IP configuration", but a static host entry in the forward looking DNS zone of the DNS server they use.
You have to understand how DNS name resolution works.
Basically a machine wanting to resolve a name into an IP address using DNS sends a request to the DNS server supposed to resolve names for said machine. The DNS server keeps a repository for association between names and IP addresses. If the DNS server has the wrong association between MachineA and an IP address, it will send back the "wrong" IP address when receiving a DNS request for that machine.

If you have control over a DNS server/DC in DomainB, and over the DHCP server for DomainB, make sure that the DHCP scope is configured to send a DNS/DC for Domain B as the FIRST DNS server (DHCP option 6). Also make sure that DHCP server can update DNS dynamically.
You should also check that the Clients themselves are correctly configured regarding dynamic updates of DNS.

Some resources:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Your results indicate that the DNS records are incorrect.  It is entirely possible for DHCP to list the IP associated with a machine as one thing, but for DNS to not have the same information.  This can occur when switching around between wireless and ethernet.  DNS scavenging is typically used to keep out-of-date records to a minimum, but even then there is typically some lag where incorrect records can be present.  These records will be present on Domain B, so there may not be much you can do.  Here's a good link for setting up DNS scavenging.
eServAuthor Commented:
Thanks for the help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.