this post was submitted on 19 Oct 2023
13 points (88.2% liked)

Linux

48069 readers
866 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

top 8 comments
sorted by: hot top controversial new old
[–] tal@lemmy.today 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@lemmy.zip 1 points 1 year ago

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

[–] HumanPerson@sh.itjust.works 1 points 1 year ago

You should be able to change the nameserver value in /etc/resolv.conf. You may need a restart for it to take effect but that should work.

[–] MiddledAgedGuy@beehaw.org 1 points 1 year ago (1 children)

It could also be browser specific. I'm not sure how you determined it's not using the pihole dns server. For example, Firefox has the option to resolve dns over https.

[–] jaykay@lemmy.zip 1 points 1 year ago

Im the Pihole GUI I see which IPs are making requests. It picks up my phone but no requests from the pc

[–] Kushia@lemmy.ml 1 points 1 year ago

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.

[–] oranki@sopuli.xyz 0 points 1 year ago (1 children)
  • Open the GUI network settings
  • Set DNS to the IP of the PiHole, make sure the "automatic" switch is off.
  • Do the above for each active interface (ethernet, wlan) and for both IPv4 and IPv6
  • Save/apply settings
  • Turn the interface(s) off, then back on
  • resolvectl flush-caches just in case

Look at resolvectl dns to check there's no DHCP-acquired DNS servers set anymore

If you use a VPN, those often set their own DNS servers too, remember to check it as well.

[–] jaykay@lemmy.zip 1 points 1 year ago

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