Link to home
Start Free TrialLog in
Avatar of Zacharia Kurian
Zacharia KurianFlag for Kuwait

asked on

when pinging domain name the additional domain's IP is resolved

One domain controller (Windows 2003 Enterprise edition) named company.com and the IP address is 192.168.2.2

Addition domain controller(Windows 2003 Enterprise edition) for company.com with IP address 192.168.2.3. In the additional Domain the preferred DNS server is set to 192.168.2.2 and the second DNS is set to 192.168.2.3.

When I ping company.com I am getting the IP of Additional domain controller all the time. But When I do an nslookup I am getting the IP of the DC i.e. 192.168.2.2

Can any one suggest a solution to solve this? I want the IP of the DC to be resolved when I ping company.com (i.e. 192.168.2.2)

Avatar of Andrej Pirman
Andrej Pirman
Flag of Slovenia image

You must understand that PING and NSLOOKUP use different methods for name resolution.

Ping uses the IP or machine name string and looks up first in DNS, then WINS and finally in local broadcast. It does not modify your computer name during resolution. So, if you ping company.com, first query to DNS is for "company.com" A-record and CNAME.

On the other hand Nslookup first tries with constructing FQDN from your string by appending domain suffix to host name prior to resolution. If the name is not found, string is devoted from left to the right for string until first dot, and query is repeated.
See how it works by switching into DEBUG mode while running NSLOOKUP:
set d2

You will see how query is executed and where answers come from.

So, if you do not have "company.com" A-record in DNS, ping will resolve by NetBIOS name, while nslookup will resolve by querying DNS server, which is set to be your DNS server for LAN adapter.
Avatar of Zacharia Kurian

ASKER

the following are the NetBIOS names of the servers

Domain Controller (primary) company.com -DC

Additional Domain Controller of company.com -ADC

When I ping by NetBios names I am getting the correct IPs.

On  both the servers A-Record in the DNS are added i.e.

same as parent folder Host(A) 192.168.2.2
same as parent folder Host(A) 192.168.2.3

also the associated PTR records are added in the DNS entry of both the servers.

I do not have WINS installed in any of the above servers and I do not want to install it.
If you ping company.com, you will get a DNS-round-robin response.  This means that DNS servers will alternate the responses they give, cycling through all possible A records.

Note that you are also getting the A records for the domain, not the A records for servers (i.e. dc1.company.com, dc2.company.com).

The way round-robin works, also lends itself to caching.  The Windows DNS client will typically cache the response from the DNS server, so excepting nslookup (which queries DNS servers directly), you will get the same result unless you flush the cache using:

ipconfig /flushdns

Also note that PRIMARY and SECONDARY DNS servers are really just a list of equally valid servers to try.  Windows does not prefer the PRIMARY server, it just uses it until it doesn't respond.  Then it uses the SECONDARY until it doesn't respond, even if the PRIMARY is restarted in the meantime.

hope that helps
ASKER CERTIFIED SOLUTION
Avatar of SteveH_UK
SteveH_UK
Flag of United Kingdom of Great Britain and Northern Ireland 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