4

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.)

0

7 Answers 7

3

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.

5
  • On WinXP Prof. it does not work. The option -b does not exist.
    – furtelwart
    Mar 6, 2009 at 12:54
  • try removing -b. Mar 6, 2009 at 13:01
  • I haven't used Windows in many years. Mar 6, 2009 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, 2009 at 14:46
  • 1
    Works on my computer™ Mar 6, 2009 at 17:25
1

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).

1
  • 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, 2009 at 7:35
1

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 10.11.2.0 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.

0
0

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.

5
  • RARP is deprecated. Mar 6, 2009 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. Mar 6, 2009 at 12:57
  • s/deprecated/obsoleted/g Mar 6, 2009 at 13:01
  • I inserted your comment.
    – furtelwart
    Mar 6, 2009 at 14:45
  • How would you use RARP? Any standard windows commands that would be capable?
    – Duveit
    Mar 6, 2009 at 18:27
0

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


device_hwaddr="XX:XX:XX:XX:XX"

# we ping every ip in the range 192.168.0.*
ip_last_number=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))
done

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

1
  • 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, 2009 at 14:52
0

Dynamic IP addresses usually are chosen from a disjunctive range. For example, static 192.168.0.0/25, dynamic 192.168.0.128/25. 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.

0

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 <192.168.0.0>  show clients | findstr "<YourMACAddressHere>"

You must log in to answer this question.