# Show static leases with more MAC addresses in line correctly in UI

**URL:** <https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584>\
**Category:** Feature Requests\
**Created:** [August 7, 2018, 9:46pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584 "2018-08-07T21:46:11Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![MagicMushroom](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@MagicMushroom](https://discourse.pi-hole.net/u/MagicMushroom)\
**Post date:** [August 7, 2018, 9:46pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/1 "2018-08-07T21:46:11Z")

</div>

fixing the static dhcp list in the setting tab to show all the mac address in the same colum instead of the first one in MAC, the second one in IP and showing the IP in the hostname [like this](https://imgur.com/a/CS2dtUv).  
There is an easy fix for it but I can't update when i use it.

---

<div class="post-metadata">

**Author:** ![RamSet](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/ramset/32/3497_2.png) [@RamSet](https://discourse.pi-hole.net/u/RamSet)\
**Post date:** [August 7, 2018, 9:50pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/2 "2018-08-07T21:50:58Z")

</div>

Those screenshots don't look like anything in the Pi-hole Admin interface.

Is that a custom theme/skin ?

---

<div class="post-metadata">

**Author:** ![MagicMushroom](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@MagicMushroom](https://discourse.pi-hole.net/u/MagicMushroom)\
**Post date:** [August 7, 2018, 9:59pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/3 "2018-08-07T21:59:18Z")

</div>

No it is because i use f.lux and dark reader addon on chrome

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [August 7, 2018, 10:24pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/4 "2018-08-07T22:24:51Z")

</div>

What does the same display look like in the standard Pi-Hole interface, and is that what you want to change?

---

<div class="post-metadata">

**Author:** ![RamSet](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/ramset/32/3497_2.png) [@RamSet](https://discourse.pi-hole.net/u/RamSet)\
**Post date:** [August 7, 2018, 10:25pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/5 "2018-08-07T22:25:31Z")

</div>

I don't see the same layout on my side.  
i have 33 defined static entries and they all show like this:

 ![image](https://discourse.pi-hole.net/uploads/default/original/2X/4/442e9ef10ee7705fab3bb852eb1ced285a532a6f.png)

With a scrollbar.

---

<div class="post-metadata">

**Author:** ![MagicMushroom](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@MagicMushroom](https://discourse.pi-hole.net/u/MagicMushroom)\
**Post date:** [August 7, 2018, 10:29pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/6 "2018-08-07T22:29:31Z")

</div>

that's because you just have 1 MAC address per host. When you use an extender it change the MAC address so you have 2 MAC address per wireless client and in setting/Web interface you can change remove the boxed layout

---

<div class="post-metadata">

**Author:** ![RamSet](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/ramset/32/3497_2.png) [@RamSet](https://discourse.pi-hole.net/u/RamSet)\
**Post date:** [August 7, 2018, 10:30pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/7 "2018-08-07T22:30:31Z")

</div>

I understand.

What happens when both MAC addresses are present (live on the network)?

---

<div class="post-metadata">

**Author:** ![MagicMushroom](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@MagicMushroom](https://discourse.pi-hole.net/u/MagicMushroom)\
**Post date:** [August 7, 2018, 10:31pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/8 "2018-08-07T22:31:44Z")

</div>

both MAC address can't be present at the same time because it's either connecter to the router or to the extender.  
Edit:that's the difference when you got 1 or 2 MAC address  
[https://imgur.com/XSSdM9q](https://imgur.com/XSSdM9q)  
or at least the difference that i'm asking a fix for

---

<div class="post-metadata">

**Author:** ![RamSet](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/ramset/32/3497_2.png) [@RamSet](https://discourse.pi-hole.net/u/RamSet)\
**Post date:** [August 7, 2018, 10:37pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/9 "2018-08-07T22:37:16Z")

</div>

It shows like this on my side after adding a different mac for the same IP:

 ![image](https://discourse.pi-hole.net/uploads/default/original/2X/b/bc3fd0021a09c5509778d0dfe1f21908f360cda3.png)

---

<div class="post-metadata">

**Author:** ![MagicMushroom](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@MagicMushroom](https://discourse.pi-hole.net/u/MagicMushroom)\
**Post date:** [August 7, 2018, 10:51pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/10 "2018-08-07T22:51:18Z")

</div>

you can have more than 1 MAC address on the same line.

```
dhcp-host=7C:ED:8D:7D:09:BA,192.168.1.52,Salon-Xbox360
dhcp-host=AE:84:C6:DC:11:60,00:1D:FE:DC:11:60,192.168.1.53,Salon-Tablet

```

That's what it look like in the 04-pihole-static-dhcp.conf file  
The first one only have 1 MAC address because it's wired, the second one is wireless so it have 2 MAC address. The advantage is that it will remove the old leases on the other MAC address when you change the connection point

---

<div class="post-metadata">

**Author:** ![MagicMushroom](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@MagicMushroom](https://discourse.pi-hole.net/u/MagicMushroom)\
**Post date:** [August 7, 2018, 10:58pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/12 "2018-08-07T22:58:05Z")

</div>

What i want to change: When you got a dual MAC address i want both of them to be in the colum of the table.  
In the standard interface it show as [this](https://i.imgur.com/Ebcclpt.png).  
I would like to show it as [this](https://i.imgur.com/r663v1U.png).

The dark theme and the yellow hue aint part of the pi-hole setting page , it was made by an extension and a windows application.

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [August 7, 2018, 11:00pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/13 "2018-08-07T23:00:01Z")

</div>

What router are you running that with an extender uses two MAC addresses? Are your devices switching between wired and wireless?

---

<div class="post-metadata">

**Author:** ![MagicMushroom](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/ac91a4/32.png) [@MagicMushroom](https://discourse.pi-hole.net/u/MagicMushroom)\
**Post date:** [August 8, 2018, 12:57am UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/14 "2018-08-08T00:57:48Z")

</div>

No, the devices are switching between the extender and the router in wireless:  
[https://forum.tp-link.com/showthread.php?86990-TL-WA854RE-wifi-extender-changes-client-MAC-address](https://forum.tp-link.com/showthread.php?86990-TL-WA854RE-wifi-extender-changes-client-MAC-address)

note:  
The extender is a TP-link RE305 so you can't send the original MAC to the router.  
The router is a Smart RG

As a matter of fact i have one way to fix it, but I don't know if the function is used somewhere else.  
If you change in `/var/www/html/admin/scripts/pi-hole/php/savesettings.php` the `readStaticLeasesFile` by

```
function readStaticLeasesFile()
{
    global $dhcp_static_leases;
    $dhcp_static_leases = array();

    $dhcpstatic = @fopen('/etc/dnsmasq.d/04-pihole-static-dhcp.conf', 'r');
    if(!is_resource($dhcpstatic))
        return false;
    //run until end of file
    while(!feof($dhcpstatic))
    {
        //Creating variable
        $mac = ""; $ip = ""; $hostname = ""; $i = 0;
        //separate each value and remove the "dhcp-host="
        $local_data = explode(",",trim(fgets($dhcpstatic)));
        $local_data[0] = substr($local_data[0],10);
        //Start validating
        for($i = 0; $i < count($local_data); $i++)
        {
            if(strlen($local_data[$i]) > 0)
            {
                if(validMAC($local_data[$i])) $mac .= " and {$local_data[$i]}";
                elseif(validIP($local_data[$i])) $ip = $local_data[$i];
                else $hostname .=", {$local_data[$i]}";
            }
        }
        //remove the first " and " and ", " from $mac and $hostname
        if(strlen($mac) >= 5) $mac = substr($mac , 5);
        if(strlen($hostname) >= 2) $hostname = substr($hostname , 2);

        //if there is at least one value send the leases
        if(strlen($mac) > 0 || strlen($ip) > 0 || strlen($hostname) > 0)
            array_push($dhcp_static_leases,["hwaddr"=>$mac, "IP"=>$ip, "host"=>$hostname]);
    }
    return true;
}

```

In the last version (3.3 I think) it was working.

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [June 9, 2020, 10:34am UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/15 "2020-06-09T10:34:07Z")

</div>

> [@MagicMushroom](#):
>
> As a matter of fact i have one way to fix it

Does this still work with v5.0? If you already have a fix for this it would be great if you would submit a PR on github so others could also benefit.

---

<div class="post-metadata">

**Author:** ![amigoz](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/a88e57/32.png) [@amigoz](https://discourse.pi-hole.net/u/amigoz)\
**Post date:** [February 15, 2019, 11:44pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/16 "2019-02-15T23:44:54Z")

</div>

Could you improve displaying static entries with more MAC addresses in admin UI (Settings \> DHCP)? For ex. this is valid 04-pihole-static-dhcp.conf file entry:

dhcp-host=00:11:22:33:44:55,66:77:88:99:aa:bb,192.168.1.12,laptop

Issue is that second MAC address is displayed in IP address field and Hostname field shows IP address. Hostname part is not shown at all. Inserting such entries through UI seems to work fine and I hope you keep it that way (not limiting to single MAC address).

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [June 9, 2020, 10:35am UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/17 "2020-06-09T10:35:55Z")

</div>

I moved your topic into this because it is the same FR. Your vote was transferred too.

---

<div class="post-metadata">

**Author:** ![danielo515](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/danielo515/32/9079_2.png) [@danielo515](https://discourse.pi-hole.net/u/danielo515)\
**Post date:** [February 17, 2021, 7:33am UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/18 "2021-02-17T07:33:15Z")

</div>

This is also a problem I'm experiencing. My wyzecams loves to change their mac address, so I need to add several macs per cam. It will be awesome to be able to do this from the UI, but at least displaying it correctly will help a lot.

---

<div class="post-metadata">

**Author:** ![eugef](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/eugef/32/24189_2.png) [@eugef](https://discourse.pi-hole.net/u/eugef)\
**Post date:** [March 11, 2021, 5:01pm UTC](https://discourse.pi-hole.net/t/show-static-leases-with-more-mac-addresses-in-line-correctly-in-ui/11584/19 "2021-03-11T17:01:13Z")

</div>

I also would like to +1 this feature.  
I'm using pi-hole as DHCP server with all my home devices reserved IP addresses. Some devices (like Roku player for example) can be connected via Wired or Wireless connection (with different MAC addresses) however it is the same device and I would like it to get assigned the same IP.  
I managed to achieve this by modifying directly

```
/etc/dnsmasq.d/04-pihole-static-dhcp.conf

```

changing the line for my Roku to

```
dhcp-host=D8:31:34:22:22:22,D8:31:34:22:22:23,192.168.1.72,RokuUltra

```

and it works great. I switch from wired and wireless on my Roku and back and i get the same IP. However on the pi-hole UI it looks like this:

 ![image](https://discourse.pi-hole.net/uploads/default/original/3X/a/d/ad9a4999edc3870ebec5ca46d8fd8c8fe814c697.png)

I have other devices with Wired OR Wireless connection (never at the same time) and I would like to be able to manage this through UI.
