OK, so pi-hole has been running for a few hours now after flusing the cache between stopping and restarting the FTL service and the same record of an old device and what was its IP has reappeared in the Top Clients lists.
The device and what was its IP address, do not physically exist within my network and no other devices have taken its place.
Any ideas why it keeps coming back?
Sorry, I probably should have been more verbose in my recommendation:
There is no cache to clear, instead, you should have clicked Flush network table via Pi-hole's Settings | System.
Also, run from your Pi-hole machine, please share the output of:
sorry for the delayed response.
The "flush" was by running pihole flush from the command line on my pihole machine.
I've now clicked the "Flush network table" button in Settings>System.
When I run "echo ">top-clients(12) >quit" | nc localhost 4711", the following is returned:
Sorry for the late reply.
I am running an Edgerouter4 and there is no reference to the IP address or fqdn of the machine in question.
I originally had my pi-hole on a RasPi4 but ditched it for a VM in Proxmox, so it was a clean install from scratch. The IP and fqdn has been there from day 1.
There was no reference to the IP address and/or device's fqdn in the hosts file on the Edgerouter.
Also, rather than running "echo 172.16.200.{1..254} | xargs -n 1 dig +short @<EDGEROUTER_IP> -x" for the entire IP range of the subnet, I narrowed the IP range to only the single IP address that I am seeing in pi-hole - 172.16.200.210, but I get the following response:
;; communications error to 172.16.254.251#53: timed out
;; communications error to 172.16.254.251#53: timed out
;; communications error to 172.16.254.251#53: timed out
;; no servers could be reached
Yes, i changed the <EDGEROUTER_IP> for the actual IP address of the Edgerouter
That command was tailored to query the box that does DHCP services for your network.
Most routers register hostnames in DNS that are advertised during the DHCP lease negotiation.
Is the Edgerouter doing DHCP services for your network?
If not, run that command against the box that does DHCP for your network?
If its a single IP that your're interested in, you can do below instead to do a reverse lookup (IP to name instead of name to IP):
Yes, the Edgerouter is performing the DHCP service for my network.
When I run dig +short @172.16.254.251 -x 172.16.200.210, I still get the same error as before:
;; communications error to 172.16.254.254#53: timed out
;; communications error to 172.16.254.254#53: timed out
;; communications error to 172.16.254.254#53: timed out
;; no servers could be reached
I'm not sure how the .local TLD would impact my setup and resolve my issue.
I don't have mDNS enabled anywhere within my network.
Either that Edgerouter box doesnt run a DNS service,
or no route exists from the host that you run that dig from to the Edgerouter IP 172.16.254.251.
You can search the logs for where Pi-hole gets those <OLD_HOSTNAME>'s from with below:
sudo less --pattern='is <OLD_HOSTNAME>' /var/log/pihole/pihole.log
Eg:
$ sudo less --pattern='is hakpc' /var/log/pihole/pihole.log
[..]
Sep 15 03:00:00 dnsmasq[29841]: query[PTR] 143.0.0.10.in-addr.arpa from 127.0.0.1
Sep 15 03:00:00 dnsmasq[29841]: forwarded 143.0.0.10.in-addr.arpa to 10.0.0.2
Sep 15 03:00:02 dnsmasq[29841]: reply 10.0.0.143 is hakpc.home.dehakkelaar.nl
Above you see from top to bottom the reverse lookup made (the [PTR] query) by Pi-hole (127.0.0.1) for the 10.0.0.143 IP,
the IP address the query is being forwarded to (10.0.0.2 which is my DHCP server),
and the hakpc.home.dehakkelaar.nl reply from 10.0.0.2.
You might not have enabled it, but your OS can OOTB.
Windows 10 and up have mDNS default enabled.
Many Linux distros run an mDNS daemon OOTB.
And MacOS has Bonjour.
I would sort out the .local thingy first before troubleshooting any other issues.
You never know
Whats weird from above is that you address 172.16.254.251 as destination, but the error displays a different IP 172.16.254.254 thats trying to connect to.
Not sure whats going on here.