Finding machines using a specific DNS server

Thomas N
Thomas N used Ask the Experts™
on
Is there a way to find out what machines are using a specific DNS server? We are switching servers and want to make sure any static assigned machines are not using the old servers anymore.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Team Lead RRS Desk
Top Expert 2016
Commented:
On the Microsoft site the recommended the WireShark Utility. See link below.

https://www.wireshark.org/
Top Expert 2014
Commented:
There's a few ways.
 - enable logging on the DNS server.  After a while, check the logs to see which machines have contacted it.
 - run a network capture on the DNS server and filter on DNS traffic
 - script something that will check the NIC settings on a list of client machines you provide
Mohammed KhawajaManager - Infrastructure:  Information Technology
Commented:
Ways you could do it:

1.  Protocol analyzer (MS Network Monitor, WireShark, etc.)
2.  DNS logging and review log files
3.  Use a utility such as SpiceWorks, Zabbix, LanSweeper to identify network settings
4.  Easiest way to do it would be to have a GPO which is a computer policy and it runs a powershell as per below:
get-dnsclientserveraddress | out-file \\server\share\$env:computername.txt

You could then run a DOS command on the all files to find a missing DNS server (i.e. 192.168.15.1)
type \\server\share\*.txt  | find /i "192.168.15.1."
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Top Expert 2014

Commented:
There's a caveat with #4 above - Get-DNSClientServerAddress is only available on Win8 and newer.
Mohammed KhawajaManager - Infrastructure:  Information Technology

Commented:
Good point, I run Windows 10 and didn't even think of OS supported by different versions.  What you could do is change the powershell command to "ipconfig /all > \\server\share\%computername%.txt

You would have to manually check each text file as if you do a find for string DNS, it will always give you the primary server name.  Secondary server name is in the next line.
Todd NelsonSystems Engineer
Top Expert 2016
Commented:
The script in this article should help...


Make sure you create a TXT (c:\scripts\computers.txt) file with all of your computer names listed.  I recommend running from a Windows 2012 R2 DC for best results.  May not run against all machine you list.

The computers.txt file should look something like this...

computer1
computer2
computer3

Open in new window



The command should look something similar to this...

Get-Content C:\Scripts\computers.txt | C:\Scripts\Get-IPDetails.ps1 | ft -auto

Open in new window


Good luck.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial