Hi everyone! Can someone please walk me through changing dns on Fedora 38. I have pihole setup on my home server, but Fedora won’t use for the life of me. (It does work on my phone). Explain it like I’m 5, cos I’m losing my mind haha
Firefox and maybe some other browsers default to DNS-over-HTTP. Unless Fedora has disabled that, you won't see requests from them on a DNS server. Use the ping command or something instead. If you see those queries, but none from the browser, that's probably the problem.
If you want Firefox to issue queries to your DNS server, you're probably gonna have to disable DNS-over-HTTP in the browser.
I don't know what the default config for Fedora is, but it's perfectly acceptable for a system to use a local caching DNS server, and they might set one up by default. If so, trying to resolve a name will only resolve it once until the TTL on the response expires. Try to resolve a new name each time.
I don't know what the Fedora-specific config looks like, or whether systemd has changed anything, but the three files that you historically need to care about on a Linux system for name configuration are /etc/resolv.conf (which normally lists the IP address of the nameserver), /etc/hosts, which lets you manually have host-IP mappings, and /etc/nsswitch.conf (which normally you don't need to fiddle with, but determines how non-DNS methods are used to resolve names). If your DNS server's IP address is listed in resolv.conf, you're probably good. If your system automatically regenerates those, it's convention to have a comment at the top of the file indicating what regenerated it, so you know where to look.
Lastly, there's a command called dig. If you run dig +trace hostname.to.look.up, it'll show you the series of queries that are being issued to different nameservers. It's probably the single best tool to get visibility into DNS. It can't show you everything. It won't deal with nsswitch.conf stuff, where a name resolution attempt might be resolved before it gets to DNS. It doesn't replicate the web browser's name resolution process, so DNS-over-HTTP won't show up, and it doesn't expose Firefox's internal DNS cache (which, yes, it has and will cause it to not actually attempt to resolve the same name repeatedly normally). But it's the first thing I'd look at if I wanted to try to understand what was happening during DNS resolution if I were seeing unexpected behavior. You get to see what queries are going to what DNS servers and what the response is, and it cuts caches out of the picture. If you get things working with dig, then I'd go and check other software like Firefox.
Assuming you get your IP address from a DHCP server such as your router, you should change what DNS server is set there and then restart any devices you are trying to use with the PiHole.
You can just restart the network service on your Fedora PC or reboot it.
Thanks, I did that and so far so good. I did most of this before but it was reverting back to some other dns address and not working -_- now it works, so far
If its reverting, you may have a fallback DNS configured somewhere, or your browser is using DNS over HTTPS, which sometimes will bypass whatever DNS server you've configured.
Probably not best to do this because chances are he's using NetworkManager which will override /etc/resolv.conf. Better to set it on the connection profile itself.