DHCP Server Lookup

Script Cream

Find your DHCP server.

Download DHCP Server Lookup 0.2

I often need to know whilst debugging a network connection where my computer has picked up an IP address from, so I can find the IP address of a router, or to make sure there’s not a rogue DHCP server on the network and so on. There is no way to find this in the GUI in Mac OS X, although it is available via ipconfig on the command line:

ipconfig getoption en0 server_identifier

Needless to say I can never remember the parameters for it, so I wrote a script to automate it. With the script you can also get the DHCP server for multiple interfaces at once as well.

I’ve tested it on Tiger (10.4) and Leopard (10.5), but it may work on older versions of Mac OS X too. Due to the differences in systems older than Leopard however, the script can’t lookup the friendly interface name (”Built-in Ethernet”, “Airport”, “Firewire” and so on) but lists the interface UNIX name (en0, en1, fw0 etc). It does make a wild guess at which interface it is though based on the usual assignments.

Tested on:

  • Mac OS X 10.4 (Tiger)
  • Mac OS X 10.5 (Leopard)

Licensed under the GPL. Download the DHCP Server Lookup 0.2 script application (zip).

Changelog:

  • 0.2
    • Completely rewritten to use system_profiler.
    • More Info… button launches GUI System Profiler and focusses on the network section.
  • 0.1
    • Initial release.
  1. November 1, 2009 at 2:48 pm

    hello,

    thanks for the great quality of your blog, each time i come here, i’m amazed.

    black hattitude.

  1. May 19, 2008 at 6:49 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: