Find and display a DHCP server's IP address mac [ENG]


Have you ever needed to know the address of your DHCP server? I don't know how useful this will be to people, but it was surprisingly tough for a team of three of us to figure out, so I figured it's worth a post. Surprisingly, the address doesn't show up in the system log, ifconfig, NetInfo, or anywhere else that we thought to look (and we looked in quite a few places)!

So here's the solution,. Go to the Terminal and run this command (replace en0 with en1 if you're on AirPort):

ipconfig getpacket en0 

According to the manual page for ipconfig, this command appears to be unique to Mac OS X, first introduced in the Public Beta! The command will display a bunch of useful info, including:
server_identifier (ip): That's your DHCP server's IP address.
yiaddr: Your machine's IP address.
chaddr: Your machine's MAC address.
domain_name_server: Your domain name server(s).
There's much more in the output. Keep in mind that if you have entered an IP address manually, then you'll get no output from this command. I have tested this in both 10.4.4 and 10.3.9, and it works fine in both.

via: www.hints.macworld.com
Σχόλια