I have some computers I need to reinstall over the network, but for the install to work correctly, the computer needs to have its MAC address registered in the DNS/DHCP so that it'll be recognized and get the right IP address and thus policies from AD.

The problem is that the computer often isn't registered in the DNS/DHCP for some reason, and that won't be noticed before a late stage in the reinstall-process, and thus it's wasting a lot of time to troubleshoot this way.

I'm wondering if there is some way to query a DNS-server with a MAC address, and see if its properly registered to an IP address?

(I don't have access to AD.)


AFAIK, there's no way to query a DHCP server with a MAC address, but you can use ping and the ARP table on your computer.

ping -b <broadcast address>
arp -a

will give you the MAC and IP addresses of all the hosts in the network.

  • On WinXP Prof. it does not work. The option -b does not exist. – furtelwart Mar 6 '09 at 12:54
  • try removing -b. – Can Berk Güder Mar 6 '09 at 13:01
  • I haven't used Windows in many years. – Can Berk Güder Mar 6 '09 at 13:02
  • Does not show the wanted effect. The arp table is as empty as before and the ping command returns a time out. – furtelwart Mar 6 '09 at 14:46
  • 1
    Works on my computer™ – Can Berk Güder Mar 6 '09 at 17:25

Is it only at install time that these machines need a certain IP address to set policy? If not, why aren't they getting the correct addresses at install time? Do they get assigned the correct IP later when they are deployed?

It would seem to me that creating static entries for each machine's MAC address in the DHCP server is the solution you're looking for. In your post it sounds like you can't do that yourself, but if it's necessary your sys-admin will probably do it for you. He can also probably allow you read-only access to all static address assignments (so you can check on them before installation).

  • All machines have static IP set through the DHCP server based upon their physical MAC address, and yeah, I'd need to ask the sysadmin about actual mapping for MAC/IP's, and it's a bit of a hassle contacting him all the time a computer doesnt seem to get recognized. But maybe I can get that access. – Duveit Mar 9 '09 at 7:35

I had the same problem: I had a MAC address, but the IP address changed on me. Broadcast ping did not seem to work for me on Windows XP, and our Linux machines were on a different subnet, so brute force led me to:

for /l %i in (1,1,254) do ping -n 1 -l 1 -w 1 10.11.2.%i

Where is my subnet. Then I could do

arp -a

and look/grep for my known MAC address. (Note that Windows uses the - separator and Linux uses the : in MAC addresses).

You could extend this for a larger subnets too, with extra for loops.


You can use the Reverse Address Resolution Protocol (RARP). It resolves IP addresses to a given MAC address via a broadcast. It's old (even obsolte via DHCP), but it should work.

  • RARP is deprecated. – Can Berk Güder Mar 6 '09 at 12:54
  • Besides, RARP is used to determine the host's own IP address. Depending on how the OP is planning to use this, he might be looking for something like InARP, which, AFAIK, is also deprecated. – Can Berk Güder Mar 6 '09 at 12:57
  • s/deprecated/obsoleted/g – Can Berk Güder Mar 6 '09 at 13:01
  • I inserted your comment. – furtelwart Mar 6 '09 at 14:45
  • How would you use RARP? Any standard windows commands that would be capable? – Duveit Mar 6 '09 at 18:27

Depending on the size of your network, it can be very quick to scan every possible machine.


# we ping every ip in the range 192.168.0.*
while test $ip_last_number -ne 255; do
    ping -c 1 192.168.0.$ip_last_number >/dev/null 2>&1 &
    ip_last_number=$(($ip_last_number + 1))

# we search in the arp table if their is our device
echo $(arp|grep $device_hwaddr)

  • Thanks for comment, although it wouldnt work as it wouldnt be accessable/answering, seeing how it wouldnt have been setup yet. What I'd need is some way to query the DNS with a MAC-adress to see what its IP should be. – Duveit Dec 16 '09 at 14:52

Dynamic IP addresses usually are chosen from a disjunctive range. For example, static, dynamic It depends on your configuration.

If you don't have access to the DHCP server's configuration, I don't think there are other ways to check whether it's static or dynamic.


DNS server: no.

But, with DHCP server, you can use the [netsh DHCP] (http://technet.microsoft.com/en-us/library/bb490941.aspx) command.

What I usually like to do is just pull the entries from the specific DHCP range and then pipe only output that matches your MAC address. i.e.

Netsh DHCP server \\<myserver> scope <>  show clients | findstr "<YourMACAddressHere>"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy