Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Firstly, parsing configuration files isn't really correct. And not nearly distro-independent either.

My first idea was to search for running dhclient processes, but each distribution uses a different esoteric command line. Even the binary name itself varies. In Fedora, it's dhclient. In Ubuntu, it's dhclient3.

Is there something in /proc or /sys that indicates that an IP is dynamic?

share|improve this question
Why exactly do you need this? What exactly are you trying to accomplish? – Juliano Sep 10 '09 at 19:21
Have you grepped around in /var/lib/dhcp*/dh*lease* ? – Dennis Williamson Sep 10 '09 at 19:43
@Dennis: That looks good. I'm using it. – JCCyC Sep 10 '09 at 21:35
@Juliano: remote system info gathering. – JCCyC Sep 10 '09 at 21:35
@Dennis: Make it into an answer so I can accept it. – JCCyC Sep 10 '09 at 21:55
up vote 4 down vote accepted

Have you grepped around in /var/lib/dhcp*/dh*lease* ?

On my Ubuntu system, as an example, /var/lib/dhcp3/ contains information about the current and recent leases.

share|improve this answer
-1 because it is dhclient-specific and there are other DHCP clients. – bortzmeyer Sep 14 '09 at 8:30
The OP specified dhclient and dhclient3 in the question. – Dennis Williamson Sep 14 '09 at 13:34
So, how do pump and others store the leases? – JCCyC Sep 16 '09 at 21:07

Check the DHCP server for a lease that matches the MAC address of the network card

share|improve this answer
... using dhcping utility. – hayalci Sep 10 '09 at 21:00
I only have access to the client machine. – JCCyC Sep 10 '09 at 21:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.