this post was submitted on 19 Oct 2023
16 points (90.0% liked)

Linux

48330 readers
641 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[–] jaykay 1 points 1 year ago

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