Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From my computer, I want to query my DHCP server to find a specific mac adress. I want to enter the hostname to search, and getting back the Mac address.

Something like :

netsh dhcp server scope show clients |find hostname

This command line doesn't works, but maybe you have some tips ?

Thank you,

share|improve this question
If you remove the |find hostname, what error messages do you receive? I can see two issues: 1.) You're not specifying the dhcp server name/IP, netsh dhcp server \\servername... 2.) You're not specifying which scope you want: netsh dhcp server \\servername scope show clients. – jscott Apr 12 '12 at 12:50
up vote 0 down vote accepted

If you are comfortable with Powershell, this script will help you find what you need:

This script almost works as well. It currently lists extra clients. Some regex magic with the find command parameters could fix this. Save to to a .cmd file and specify your dhcppserver and a valid scope.

for /f "skip=4 delims=: tokens=2" %%a in ('nslookup %1') do set IP=%%a
netsh dhcp server \\ourdhcpsvr scope show clients|findstr "%IP%"
share|improve this answer

With netsh dhcp server \\servername scope show clients you get a list without client names, when you add "1" at the end of this line, you get the client names as well:

netsh dhcp server \\servername scope show clients 1
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.