1

Can I query my windows 2003 dhcp server from my windows xp in order to get the ip address if i have the mac address or otherwise.

AdrienF
  • 125
  • 3
  • 10

1 Answers1

4

For a windows 2003 server query:

netsh dhcp server <type.srvIP.here> scope s.s.s.s show client | find "clientIP"
netsh dhcp server <type.srvIP.here> scope s.s.s.s show client | find "MACAddress"

You'll need to know the scope (s.s.s.s) in which this client is on, to show scopes:

netsh dhcp server <type.srvIP.here> show scope

Why not just query your network switch for it though?:

arp -a "clientIP"
arp -a | find "MACAddress"
l0c0b0x
  • 11,867
  • 7
  • 47
  • 76
  • The command arp -a don't work because my network has many vlans seperated by routers. I want to search an ip address which is in an other vlans. For the netsh command, i try to create a script to do this remotely from a desktop not directly on my dhcp servers. On my xp i don't have the context dhcp in netsh. – AdrienF Aug 07 '09 at 09:55
  • Ah, yes. Windows XP's netsh is a bit limited, unfortunately I don't know if it's possible to extend it (might be a good SF question. At least for finding the MAC address of a windows host, you can use nbtstat -A "hostIP". – l0c0b0x Aug 07 '09 at 10:44
  • 1
    Thank you for the nbtstat command, it will help me a lot. The best would be to do the opposite, but I think it will be enough to make my script. – AdrienF Aug 07 '09 at 11:50