[Webinar] Streamline your web hosting managementRegister Today

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

Which DNS server is connected?

We have one DNS (named L) server and its failover server (B). Both are set as Primary and Secondary DNS on each server within the same LAN network. DNS settings are all same.

Somehow when I checked with DNS is in use/connected as DNS for each servers, some server shows L and some shows B. I used this command : >echo %LOGONSERVER%

Did I use the right command?
If so why I got this information?

Thank you very much!

Jing
0
hanjgr
Asked:
hanjgr
6 Solutions
 
TunerMLCommented:
%LOGONSERVER% reflects which Domain Controller you are currently logged into, ipconfig /all look for Primary/Secondary DNS servers, as long as primary is available you should be using that one.
0
 
pony10usCommented:
You can also do an NSLookup of a device on the network and it will tell you which DNS server it pulls the information from. Normally that would be your primary.

The difference between methods is that TunerML's will only give you the IP address of the two DNS servers.  The NSLookup will give you the FQDN as well as IP address of the server that responds to the DNS query.
0
 
Suliman Abu KharroubIT Consultant Commented:
The proper tool to check which DNS server is answering DNS queries is nslookup...

issue the nslookup from client machine and it will tell you the server which it uses.

To check the dns serer health run below command on both dcs:

Dcdiag /test:DNS
0
SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

 
Bruno PACIIT ConsultantCommented:
Hi,

I just want to give some precision about DNS primary and secondary...

Microsoft DNS client on windows computers or server uses what we can call a "preferred DNS server". When the DNS client has to resolve a DNS name it will not request the primary DNS server but the "preferred DNS server".
Waht is the preffered DNS server ? Well... simply the last successfully requested DNS server.
That means that if for any reason the currentlu used DNS server did not answer or take too much time to answer the DNS client might have decided to interrogate the next one in the list and if this one answers it becomes the new preferred DNS server and will always be requested at first on next name resolution.

So the "primary" or "secondary" order is only useful at startup time. When a computer is started it will try to reach the first DNS server in the list, the one that is called "primary" in IP settings, but after that the "primary" notion no more exists... only the preferred DNS server notion exists.

Have a good day.
0
 
pony10usCommented:
PaciB:

Very good point.  To make that a little stronger, lets say you have two DNS servers. One is in your office and the other is on across the state from you. Now lets say that you "primary" DNS is set to the one across the state. Naturally you would think that it would use that one first however, due to network congestion, it is quicker to get the response from the one in your local office.  This becomse your "preferred" and will continue to be the one you resolve with unless/until it can't respond.

The same is true in the opposite scenario where the local may be your "primary" but can't respond for some reason so the one across the state becomes the "preferred".

nslookup is still the best way to determine what server is providing the lookups at any given point in time.
0
 
DrDave242Commented:
I'm pretty sure nslookup always defaults to the preferred server.  In fact, I just tested this by setting my workstation's DNS servers to 127.0.0.1 (certainly not valid) and 8.8.8.8 and flushing the resolver cache.  I ran nslookup, and it defaulted to 127.0.0.1.  Then I closed nslookup and pinged www.google.com.  It was able to resolve the FQDN to an address, so DNS worked as it should.  Since there's no DNS server running on 127.0.0.1, it had to have gotten the address from 8.8.8.8.  However, I then ran nslookup again, and it defaulted to 127.0.0.1.

I don't think nslookup can tell you which server the Windows resolver is using, because it uses its own separate resolver.  The only surefire way I can think of to determine which DNS server is being used by a machine at a given time is to run a packet trace.
0

Featured Post

Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

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