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

  • @tal
    link
    2
    edit-2
    7 months ago

    How are you testing that it works?

    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.

    • Footnote2669OP
      link
      fedilink
      17 months ago

      Oh wow, thanks for that detailed response. I’ll try that and see how I get on :)