Finding DHCP Server

Normally I use my MacBook at home and some times in office also. It is configured for DHCP in both places.

But today when I started MacBook in office I found that I am unable to connect to net. Found that I am using IP number of series 169.*.*.* which is not what I expected. It should be in the series of 192.168.*.*

I tried renewing the DHCP lease. But in vain. Same IP is coming again. Finally decided that it is the problem with the DCHP Server.

But there is no way to find the DCHP server that allocated that wrong IP number. I search for 15 min then finally I found the command in a website.

ipconfig getoption en1 server_identifier

BTW this command only works in Mac. Here en1 is the network interface.

Then I found that my DHCP Server is actually down at that point. So that number which I got is allocated by the OS by default. Not the problem of DHCP Server. I started the server and renewed the IP and every thing worked perfectly.