I've got Pi-hole set up on my network, and I'm trying to get it to work with my Ubuntu 24.04 machine. I also have a Debian client on the same network that resolves local domains just fine. However, Ubuntu seems to ignore the Pi-hole completely.
When I check the DNS status with `resolvectl`, it shows that my current DNS server is correctly set to the Pi-hole's IP, 192.168.1.165. But when I try looking up a local domain using `nslookup`, I get a SERVFAIL error when querying through the local resolver at 127.0.0.53. On the other hand, when I directly query the Pi-hole, it resolves the local domain correctly.
I'm looking for suggestions on how to fix this and get my Ubuntu machine to route its DNS queries through Pi-hole. Any help would be appreciated!
5 Answers
It sounds like you might want to avoid using `.local` for your home network's domain since mDNS might interfere with it. If mDNS is enabled, it'll look for responses from services like Avahi for those requests, which could be causing the SERVFAIL issue you're encountering.
Honestly, systemd can be a pain sometimes! And note that the output clearly suggests not to modify that resolv.conf file directly.
Keep in mind that the `.local` domain has special treatment; the resolver opts for mDNS instead of querying your defined DNS server. Check your `/etc/nsswitch.conf`, as it likely has mDNS at the start. You could either rename your local domain to something like `.lan` or alternatively, install Avahi to handle mDNS queries properly.
Just a thought, since you're having this issue with Ubuntu 24.04 and systemd-resolved, have you considered removing it or reconfiguring it? I wonder if that's a potential route to fix your DNS issues.
That seems a bit aggressive for a solution, don't you think? Just trying to understand the responses here.
Here’s a useful guide that could help you out: [check this link](https://www.linuxuprising.com/2020/07/ubuntu-how-to-free-up-port-53-used-by.html). It addresses some common conflicts with DNS on Ubuntu.
That actually worked for me! Quick question, is there a way to also set a secondary DNS like Cloudflare's 1.1.1.1 or Google’s 8.8.8.8 just in case mine fails?
I don’t think that’s the main issue here, though.