How to find your DHCP Server Address under Mac OS X

Here’s how to find out the IP address of the DHCP Server your Mac is currently using to obtain it’s IP address.

ipconfig getoption en0 server_identifier

You can also do more with ipconfig, things like determine the router
address for an interface:

ipconfig getoption en0 router

this is sure easier than what I used to do:

netstat -nr | grep default | awk '{print $2}';

this method, however, returns the system-wide default router whereas the ipconfig method returns the router for an individual interface.

replace en0 for en1 if using AirPort…

This article was posted by Kai Howells. If you liked this content and have any technical work in the Melbourne area, say hello via my contact form or give me a call on 0419 361 653 - I cover most of the greater Melbourne area and my rates are competitive.

Leave a Reply

Your email address will not be published. Required fields are marked *