Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Is there a command I can use to ask the dhcpd server which addresses have been assigned?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

No, you can only get this information server side from the DHCP server. This information is contained in the DHCP server's .lease file: /var/lib/dhcpd/dhcpd.leases, if you're using ISC's DHCP server.


$ more /var/lib/dhcpd/dhcpd.leases
# All times in this file are in UTC (GMT), not your local timezone.   This is
# not a bug, so please don't ask about it.   There is no portable way to
# store leases in the local timezone, so please don't request this as a
# feature.   If this is inconvenient or confusing to you, we sincerely
# apologize.   Seriously, though - don't ask.
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-V3.0.5-RedHat

lease {
  starts 4 2011/09/22 20:27:28;
  ends 1 2011/09/26 20:27:28;
  tstp 1 2011/09/26 20:27:28;
  binding state free;
  hardware ethernet 00:1b:77:93:a1:69;
  uid "\001\000\033w\223\241i";
share|improve this answer
Thanks for a good starting point, but i need a command to do that & select specific columns from the big file. –  pylover Sep 21 '13 at 18:48
@pylover - glad you figured it out, thanks for the Q. –  slm Sep 21 '13 at 19:01
In Debian 7 (maybe others), the file is located in /var/lib/dhcp/dhcpd.leases –  Mario J. Barchéin Molina May 12 at 10:39

egrep command can be used to get an output:

egrep "lease|hostname|hardware|\}" /var/lib/dhcpd/dhcpd.leases


lease {
  hardware ethernet 20:6a:8a:55:19:0a;
  client-hostname "Maryam-PC";
lease {
  hardware ethernet 00:16:ea:51:d3:12;
  client-hostname "parsoon";
lease {
  hardware ethernet 00:17:c4:3f:84:e3;
  client-hostname "zahra-ubuntu";
lease {
  hardware ethernet 58:b0:35:f1:31:2f;
share|improve this answer
typo --> /var/lib/ dhcpd /dhcpd.leases –  user418014 Oct 15 '14 at 16:19

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.