Operating System - Linux
1826337 Members
3961 Online
109692 Solutions
New Discussion

How to get the DHCP server address

 
SOLVED
Go to solution
Rajesh SB
Esteemed Contributor

How to get the DHCP server address

Hi Experts,

On a Linux machine, what is the command that I can give to get the DHCP server address that allocated the IP address and the IP address lease period.

Any pointers let me know.

Thanks & Regards,
Rajesh
3 REPLIES 3
Ivan Ferreira
Honored Contributor
Solution

Re: How to get the DHCP server address

I think that you can get that information from:

/var/lib/dhcp/dhclient.leases

dhcp-server-identifier
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Alexander Chuzhoy
Honored Contributor

Re: How to get the DHCP server address

the command:
dhclient
see the output -on line:
DHCPACK from x.x.x.x

Rajesh SB
Esteemed Contributor

Re: How to get the DHCP server address

Thanks Ivan for quick response.

This information can be found in file
/var/lib/dhcp/dhclient-eth0.leases

Thanks & Regards,
Rajesh