Upstream DNS should dictate the IP address for a domain name. At the very least, records should be updated periodically or when records are flushed and system is rebooted.
Actual Behaviour:
Pihole is seemingly storing DNS records for a long time, writing them to a file somewhere, and not updating with new DNS information even after reboot.
A while ago, I configured a static IP address, name resolution, on my Pihole to point a name to an IP address. Let's just say "my.server.com" was pointed to "1.2.3.4". Since then I moved "my.server.com" to "1.2.3.5". However, Pihole is apparently still resolving as "1.2.3.4" and after flushing tables, restarting dns, flushing, restarting Pihole, shutting down power, restarting Pihole, I cannot get it to resolve as "1.2.3.5". I now have no reference, no static ip configured, and still it's returning "1.2.3.4". I cannot find anywhere in the UI where the old IP is stored. From other systems, if I use nslookup, they all say they are getting the IP from Pihole.
So, I understand that the DNS cache is in RAM, but through reboots and power cycles, it's clear that there is a file somewhere that also has this cache. Where is that file?
There is a place somewhere in Pihole where you can make it a DHCP server as well, and create static resolutions. I haven't had that configured in a very long time. And that's why I was really surprised to see my old IP address. More surprised when all my attempts and reboots, and it still persisted.
nslookup yields:
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: my.server.com
Address: 1.2.3.4
Is Pi-hole's DHCP server currently enabled?
Is that device at 1.2.3.4 still acquiring its DHCP lease through Pi-hole?
Please upload a debug log and post just the token that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:
So, the old system is referenced/defined in the /etc/hosts file. Before I change it, where is this file managed by the GUI. I know I've never revised the file manually, but I've poked through every part of the GUI (I think), and see it no where. Best guess is it is a leftover piece of when I did have DCHP configured (which isn't now, and hasn't been configured in a while)
Thanks. Something modified it. I'm aware of only the DHCP static items and DNS items as you noted. Till jfb pointed me to those files, I wasn't even aware of where to look.
If I had to guess, it was the "Static DHCP leases configuration" because I did use that GUI long ago. However, it isn't listed in the GUI in either the DHCP or DNS settings.
Pi-hole does not modify the /etc/hosts file on the host platform. This must have been done either manually or by other software. In any event, it sounds like your problem is resolved.
Since you guys are saying Pihole doesn't modify the /etc/hosts file, I'm curious how or what modified it. Should I be concerned? Pihole is the only service running on a Raspberry Pi, which is used for nothing else. Besides the static ip and name that I'm 100% sure I set from within the GUI, there were other items seemingly related to Pihole in the /etc/hosts file. Now that I've removed the problem one, this is what remains: