Link to home
Start Free TrialLog in
Avatar of HogRing
HogRing

asked on

Ping hostname and IP don't match

I'm having some issues resolving hostnames.  I'm running server 2008 DNS servers.  When I ping a computer name it gives me that computer's ip address, then I ping the ipaddress with the -a switch to confirm the host name and it gives me a different host name for that IP.  I've copied the ping sequence below.  I've flushed the dns cache on my local machine [ipconfig /flushdns]and on the DNS servers as well [dnscmd /clearcache], but I still get the same results.  Any idea what the problem is?  Thanks in advance.


C:\Users\username.domain>ping computer1

Pinging computer1.domain.local [192.168.0.29] with 32 bytes of data:
Reply from 192.168.0.29: bytes=32 time<1ms TTL=128
Reply from 192.168.0.29: bytes=32 time<1ms TTL=128
Reply from 192.168.0.29: bytes=32 time<1ms TTL=128
Reply from 192.168.0.29: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.0.29:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\username.domain>ping -a 192.168.0.29

Pinging computer2.domain.local [192.168.0.29] with 32 bytes of data:
Reply from 192.168.0.29: bytes=32 time=1ms TTL=128
Reply from 192.168.0.29: bytes=32 time<1ms TTL=128
Reply from 192.168.0.29: bytes=32 time<1ms TTL=128
Reply from 192.168.0.29: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.0.29:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms
ASKER CERTIFIED SOLUTION
Avatar of Sarang Tinguria
Sarang Tinguria
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
DNS uses different record types to perform the two different queries.  

Your first example ping using the the host name causes a DNS query using its A or address record.  It is also known as a forward lookup and is the most common type of query.   The second ping using the IP address calls on DNS to lookup the name using a PTR or pointer record, also known as a reverse lookup.

The A address record and PTR pointer records are independent of each other.  DNS can be set to create or update the PTR record when A record is created or updated.  However it is not required or always done.  It is very easy to have an old PTR record that was never updated.  It is also possible for a destination address to have more than one address record, just like a person could be called John, Jonathan or Johnathan.  A destination could go by different names.  However a PTR pointer record can only point back to one name which could also be cause of the difference.
Avatar of HogRing
HogRing

ASKER

There are different records for the ip 192.168.0.29 in the domain and in the reverse lookup domain.  The reverse lookup domain has the incorrect host name.  I also noticed in the domain itself that there were a lot of individual records that shared the same ip address.  If I enabled scavenging will this fix the issue?  Any down side to enabiling scavenging
Hi

Refer below article and see details on scavanging

http://blogs.technet.com/b/networking/archive/2008/03/19/don-t-be-afraid-of-dns-scavenging-just-be-patient.aspx

and yes that would solve your problem and reoccurance