Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 416
  • Last Modified:

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)

0
Zacharia Kurian
Asked:
Zacharia Kurian
  • 2
1 Solution
 
Andrej PirmanCommented:
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.
0
 
Zacharia KurianAdministrator- Data Center & NetworkAuthor Commented:
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.
0
 
SteveH_UKCommented:
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
0
 
SteveH_UKCommented:
If you try:

ping company.com
ipconfig /flushdns
ping company.com
ipconfig /flushdns
ping company.com

You should see alternating responses, depending on the configuration of the DNS servers.  I've assumed the usual and default round-robin configuration.
0

Featured Post

Who's Defending Your Organization from Threats?

Protecting against advanced threats requires an IT dream team – a well-oiled machine of people and solutions working together to defend your organization. Download our resource kit today to learn more about the tools you need to build you IT Dream Team!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now