I have just installed Pi-hole v5.2.4, and set up my network to route DNS requests through it via DHCP on my router. It's working fine as far as I can tell. What is not working well though, is the Local DNS Records function.
My network looks like this:
192.168.1.1 is my router, which is my DHCP server. It's a unifi UDM-Pro.
192.168.3.14 is my pi, running Pi-hole
I have added the Local DNS record in Pi-hole for unifi to point to 192.168.1.1.
I flushed the DNS on my PC, but when accessing https://unifi/ I get the error " This site can’t be reached" DNS_PROBE_FINISHED_NXDOMAIN
I also noticed that http://pi.hole was sometimes not working on the same PC. It is working as I write this though.
You advertise not only Pihole's IP as DNS server via DHCP but also other. As clients decide on their own which DNS to choose they might not be able to resolve internal DNS records via a public server.
So I should remove the other DNS servers from the router DHCP config? I don't like the sound of that. My pi is used for a couple other applications and so gets rebooted every now and then.
If the pi is rebooting, or goes down, suddenly all the internet requests in my network stop resolving?
Yes. DNS is a critical part of your network, it might be useful if you notice that Pi-hole is down. You should consider to not use the device for a lot of other services that require a lot of reboots.
Yes. It is your DNS server (and should be the only one). There would be no difference if you reboot your router or modem - you lose part of the internet path and lose internet during that time.
Providing other DNS servers in the DHCP process allows queries to bypass Pi-hole.
You have a few options:
(1) Setup Pi-hole on an independent device that won't be rebooted. Keep it running 24/7.
(2) Add a second Pi-hole, running in parallel with the first. Advertise both those DNS servers in the DHCP process. If you reboot the first one with other things running on it, traffic will seamlessly shift to the running Pi-hole.
You need to add both a record for the plain hostname as well as the FQDN for your local domain (aka search suffix), e.g. foo and foo.localdomain.
Some software may choose to query both, so its best to safeguard for that.
It doesn't fully explain why your browsers won't resolve the plain names, though.
EDIT:
The solution also comprised removing secondary and tertiary DNS servers from your router in order to guarantee that Pi-hole is your only DNS server (as advised by yubiuser).