diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php
index b088af15..2b637863 100644
--- a/scripts/pi-hole/php/savesettings.php
+++ b/scripts/pi-hole/php/savesettings.php
@@ -565,7 +565,7 @@ function readAdlists()
if(strlen($ip) == 0)
$ip = "noip";
- // Test if this MAC address is already included
+ // Test if this lease is already included
readStaticLeasesFile();
foreach($dhcp_static_leases as $lease) {
if($lease["hwaddr"] === $mac)
@@ -578,6 +578,10 @@ function readAdlists()
$error .= "Static lease for IP address (".htmlspecialchars($ip).") already defined!
";
break;
}
+ if($lease["host"] === $hostname)
+ {
+ $error .= "Static lease for hostname (".htmlspecialchars($hostname).") already defined!
";
+ }
}
if(!strlen($error))