Duplicate entries in Top Permitted Domains

After following some instruction provided to me in a previous enquiry I raised, I successfully implemented a couple of changes to a test installation of pi-hole with a 42-local-domain-awareness.conf file and a modified 05-pihole-custom-cname.conf file where I didn't have to specify the domain names of each host's DNS entry.
This worked a treat for me in my test environment.

In prep for implementing the same for my production environment, I copied the existing 05-pihole-custom-cname.conf file to a temporary file and edited the contents as required as well as creating a temporary 42-local-domain-awareness.conf.
When I was ready to implement, I deleted the original 05-pihole-custom-cname.conf and renamed both temporary files to the required convention and restarted the DNS service (pihole restartdns).
Now, the Query Log and Top Permitted Domains lists show duplicate entries for some records of the 05-pihole-custom-cname.conf file where it lists both the old and new records.
I thought that this would just be a 24-hour thing so I'd wait out that time to see if the old records were eventually flushed from the system but they are still showing more than 24 hours later.
Duplicate entries also show in the Top Clients (total) and Top Clients (blocked only) views.

Any idea what's happened or what I can do to resolve the issue?

Please follow our help template. In particular, a debug log would be helpful.

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

Debug log uploaded.
https://tricorder.pi-hole.net/5vwlO524/

For reference, I changed the TLD from sandoverdrive.local to olearynetwork.com
I've updated all physical and virtual devices in my network to reflect this change but there are still some devices showing with the old TLD, for example desktop-9kp3tf2, while I am still seeing older records like sd-vm-ansible-01.sandoverdrive.local instead of only seeing sd-vm-ansible-01.

Not sure if I follow you here: Pi-hole just shows requested domains as received.
It's a client's decision to send duplicate queries.

Why does that bother you?
Could you share an example?

Basically any of the sd-vm-...sandoverdrive.local records were still showing in addition to the desired simplified sd-vm-... records based on the advice and instructions I was provided in an earlier enquiry about incorrect records in PiHole.

I have noticed though that since raising this recent enquiry, that the Top Permitted Domains, Top Clients (total) and Top Clients (blocked only) as well as the general Query Log views are no longer showing the .sandoverdrive.local TLD.

I now only have a single device (desktop-9kp3tf2), which is a physical Windows device, still showing in the above views with the old TLD. It obtains an IP from my router's DHCP scope, so it should only display in PiHole by its IP address rather than by its configured device name.
I renewed it's DHCP address (ipconfig /renew) and confirmed it obtained the correct TLD set in by the DHCP scope and flushed its DNS cache (ipconfig /flushdns). I've even restarted it several times in the interim, but it the old TLD for it remains showing in PiHole.

Actually, a correction to the config of the single device mentioned previously.
It is configured with a static IP, which is not a reservation from the DHCP scope.

As noted, Pi-hole just shows requested domains as received.
You'd have to investigate the client requesting resolution of desktop-9kp3tf2.
Maybe that client has bookmarked that domain?

Or perhaps I do not read your description correctly.
A screenshot may help to better understand your issue.

Here's a screenshot from PiHole showing the device with the old TLD.
image

As far as I know, there is nothing on the device that references, or is referencing, the old TLD.

Ah, I see, you are referring to Top Clients, not Top Permitted Domains. :wink:

Indeed, Pi-hole may stick to the name it first saw for that client IP.

You could try to Flush network table via Pi-hole's Settings UI, but it would be better to stop the Pi-hole service before, e.g. by running

sudo systemctl stop pihole-FTL
pihole arpflush
sudo systemctl start pihole-FTL

that fixed it!
thanks