diff -ru dhcp-4.3.6.orig/contrib/dhcp-lease-list.pl dhcp-4.3.6/contrib/dhcp-lease-list.pl
--- dhcp-4.3.6.orig/contrib/dhcp-lease-list.pl	2017-07-25 15:39:54.000000000 +0200
+++ dhcp-4.3.6/contrib/dhcp-lease-list.pl	2017-10-20 15:50:59.000000000 +0200
@@ -32,6 +32,7 @@
 my @OUIS = ('/usr/share/misc/oui.txt', '/usr/local/etc/oui.txt');
 my $OUI_URL = 'http://standards.ieee.org/regauth/oui/oui.txt';
 my $oui;
+my %oui=();
 
 my %data;
 
@@ -42,15 +43,9 @@
 
 ## Return manufactorer name for specified MAC address (aa:bb:cc:dd:ee:ff).
 sub get_manufactorer_for_mac($) {
-    my $manu = "-NA-";
-
-    if (defined $oui) {
-	$manu = join('-', ($_[0] =~ /^(..):(..):(..):/));
-	$manu = `grep -i '$manu' $oui | cut -f3`;
-	$manu =~ s/^\s+|\s+$//g;
-    }
-
-    return $manu;
+	my ($k,$d);
+	### starting grep for every MAC address is too slow
+	return((exists($oui{$k=uc(substr($_[0]=~tr/0-9a-fA-F//cdr,0,6))}) and defined($d=$oui{$k}))?$d:"-NA-");;
 }
 
 ## Read oui.txt or print warning.
@@ -66,6 +61,17 @@
     if (not defined $oui) {
 	print(STDERR "To get manufacturer names please download $OUI_URL ");
 	print(STDERR "to /usr/local/etc/oui.txt\n");
+    } else {
+        ### faster is to read MAC address into hash
+        if (open I,"<$oui") {
+            while (<I>) {
+                chomp;
+                $oui{uc($1)}=$2 if (/^([a-f0-9]{6})\s+\(base 16\)\s+(\S.*)/i);
+            }
+            close I;
+        } else {
+            die "$!\n";
+        }
     }
 }
 
@@ -109,7 +115,8 @@
 
 	if ($counter) {
 	    my $percent = (($counter / $total_leases)*100);
-	    printf "Processing: %2d%% complete\r", $percent;
+        ### display progress to STDERR
+	    printf STDERR "Processing: %2d%% complete\r", $percent;
 	    ++$counter;
 	}
 
@@ -134,7 +141,22 @@
 
 	if ($opt_keep eq 'all') {
 	    push(@leases, \%entry);
-	} elsif (not defined $tmp_leases{$mac}  or  $tmp_leases{$mac}{'date_end'} gt $date_end) {
+    # if there are multiple DHCP leases for the same MAC with different but
+    # still valid end time, the last one (according to end time) shoud be
+    # stored and printed. Otherwise only the first record will be stored, which
+    # can contain old hostname, if the host changed his hostname in short
+    # period
+    #
+    # $tmp_leases{$mac}{'date_end'} gt $date_end
+    # incorrect: has stored lease bigger (newer) end time than current lease?
+    # then replace newer lease with current older one
+    #
+    # should be
+    #
+    # $tmp_leases{$mac}{'date_end'} le $date_end
+    # correct: has stored lease lower (older) end time than current lease?
+    # then replace older lease with current newer lease
+	} elsif (not defined $tmp_leases{$mac}  or  $tmp_leases{$mac}{'date_end'} le $date_end) {
 	    $tmp_leases{$mac} = \%entry;
 	}
     }
