Pi-hole DNS server is not working

sudo grep -v '#\|^$' /etc/dhcpcd.conf

grep: /etc/dhcpcd.conf: No such file or directory

cat /etc/resolv.conf

> # This file is managed by man:systemd-resolved(8). Do not edit.
> #
> # This is a dynamic resolv.conf file for connecting local clients to the
> # internal DNS stub resolver of systemd-resolved. This file lists all
> # configured search domains.
> #
> # Run "resolvectl status" to see details about the uplink DNS servers
> # currently in use.
> #
> # Third party programs must not access this file directly, but only through the
> # symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
> # replace this symlink by a static file or a different symlink.
> #
> # See man:systemd-resolved.service(8) for details about the supported modes of
> # operation for /etc/resolv.conf.
> 
> nameserver 127.0.0.53
> options edns0
> search home

resolvectl status

?

resolvectl status

Global
       LLMNR setting: no                  
MulticastDNS setting: no                  
  DNSOverTLS setting: no                  
      DNSSEC setting: no                  
    DNSSEC supported: no                  
          DNSSEC NTA: 10.in-addr.arpa     
                      16.172.in-addr.arpa 
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa 
                      18.172.in-addr.arpa 
                      19.172.in-addr.arpa 
                      20.172.in-addr.arpa 
                      21.172.in-addr.arpa 
                      22.172.in-addr.arpa 
                      23.172.in-addr.arpa 
                      24.172.in-addr.arpa 
                      25.172.in-addr.arpa 
                      26.172.in-addr.arpa 
                      27.172.in-addr.arpa 
                      28.172.in-addr.arpa 
                      29.172.in-addr.arpa 
                      30.172.in-addr.arpa 
lines 1-23...skipping...
Global
       LLMNR setting: no                  
MulticastDNS setting: no                  
  DNSOverTLS setting: no                  
      DNSSEC setting: no                  
    DNSSEC supported: no                  
          DNSSEC NTA: 10.in-addr.arpa     
                      16.172.in-addr.arpa 
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa 
                      18.172.in-addr.arpa 
                      19.172.in-addr.arpa 
                      20.172.in-addr.arpa 
                      21.172.in-addr.arpa 
                      22.172.in-addr.arpa 
                      23.172.in-addr.arpa 
                      24.172.in-addr.arpa 
                      25.172.in-addr.arpa 
                      26.172.in-addr.arpa 
                      27.172.in-addr.arpa 
                      28.172.in-addr.arpa 
                      29.172.in-addr.arpa 
                      30.172.in-addr.arpa 
                      31.172.in-addr.arpa 
                      corp                
                      d.f.ip6.arpa        
                      home                
                      internal            
                      intranet            
                      lan                 
                      local               
                      private             
                      test                

Link 3 (wlp5s0)
      Current Scopes: none
DefaultRoute setting: no  
       LLMNR setting: yes 
MulticastDNS setting: no  
  DNSOverTLS setting: no  
      DNSSEC setting: no  
    DNSSEC supported: no  

Link 2 (enp0s31f6)
      Current Scopes: DNS        
DefaultRoute setting: yes        
       LLMNR setting: yes        
MulticastDNS setting: no         
  DNSOverTLS setting: no         
      DNSSEC setting: no         
    DNSSEC supported: no         
  Current DNS Server: 192.168.1.1
         DNS Servers: 192.168.1.1
          DNS Domain: ~.         
                      home       
~
~
~

nslookup pi.hole 192.168.1.1

?

nslookup pi.hole 192.168.1.1
Server: 192.168.1.1
Address: 192.168.1.1#53

** server can't find pi.hole: REFUSED

Thats different from what you initially posted:

Is above the full output ? No "Server" mentioned ?
Has DNS severs changed in meantime ?

Your DNS path through the router doesn't appear to lead to Pi-Hole. When you went straight to Pi-hole the router was out of the loop and it worked.

1 Like

Yeah and above.
The lookup should return the IP of Pi-hole for proper blocking to work:

dehakkelaar@laptop:~$ nslookup pi.hole
Server:         10.0.0.2
Address:        10.0.0.2#53

Name:   pi.hole
Address: 10.0.0.2

nslookup pi.hole 192.168.1.249

Connects to Pi-Hole

nslookup pi.hole

Times out

nslookup pi.hole 192.168.1.1

Server cant find Pi-Hole

Your DNS path through the router doesn't appear to lead to Pi-Hole. When you went straight to Pi-hole the router was out of the loop and it worked.

That's weird because I only changed the DNS in my router setting and not for any of my devices individually.

Can you post screenshots of all your router DNS and DHCP settings ?
Can paste directly into discourse here.
Try configure the router properly by handing out the Pi-hole IP as a single DNS server to the clients through the DHCP process:

https://docs.pi-hole.net/main/post-install/

If you dont have those options in your router, you could also let Pi-hole do DHCP for your network intead of your router:

Is that all there is ? No LAN DHCP settings etc ?
Screenshots posted are for the WAN (Internet) side of the router and not the LAN side where Pi-hole and the clients are connected.

EDIT: ow you might want to redact your "Wan IPv6 Address" from screenshot above.

Turn off IPv6 and restart/renew and see if situation improves.

Above and disconnect/reconnect network for that Linux test client to have effect.
And dont configure your router to be an upstream DNS server for Pi-hole or you'll be creating a DNS loop!
You'll be missing out on individual client stats on the web GUI with this setup but for that, you'd really need a router with more options.

Turn off IPv6 and restart/renew and see if situation improves.

It didn't change anything.

Is there anything here that I can change?

Set the DHCP to Pi-hole, and disable DHCP on the router.

I flipped DHCP to disabled on my router and clicked enable on Pi-Hole, but still no luck :confused:

Try renew DHCP lease on the Linux client:

sudo dhclient -r; sudo dhclient -v

Restart the router and renew the DHCP lease on all connected clients.

I accidentally unplugged the ethernet cable from the raspberry pi, when I plugged it back in everything started to work fine. Thank you guys for all the help! I really appreciate it !

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.