Discussion Thread Pi-Hole Sticky

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8
Author Message
rnix
DD-WRT User


Joined: 23 Feb 2016
Posts: 200

PostPosted: Sun Mar 24, 2024 12:34    Post subject: Reply with quote
I ran into issue where my current setup results huge number of DNS queries and eventually pihole rate limiter kicks in which results no connection.
10.10.10.254 is pihole

It happens only when I force pihole DNS with firewall rules taken from sticky below, based on example 2
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1256879#1256879

Seems something causes loop in DNS chain, but I cannot figure out what exactly.


Code:

# restrict traffic between br0 and br1
iptables -I INPUT -i br1 -m state --state NEW -j DROP
iptables -I INPUT -i br1 -p udp --dport 67 -j ACCEPT
iptables -I INPUT -i br1 -p udp --dport 53 -j ACCEPT
iptables -I INPUT -i br1 -p tcp --dport 53 -j ACCEPT
iptables -I FORWARD -i br1 -d 192.168.0.0/16 -m state --state NEW -j DROP
iptables -I FORWARD -i br1 -d 10.0.0.0/8 -m state --state NEW -j DROP
iptables -I FORWARD -i br1 -d 172.16.0.0/12 -m state --state NEW -j DROP

# force pihole dns for b0
iptables -t nat -I PREROUTING -i br0 ! -s 10.10.10.254 ! -d $(nvram get lan_ipaddr) -p tcp --dport 53 -j DNAT --to $(nvram get lan_ipaddr):53
iptables -t nat -I PREROUTING -i br0 ! -s 10.10.10.254 ! -d $(nvram get lan_ipaddr) -p udp --dport 53 -j DNAT --to $(nvram get lan_ipaddr):53

# force pihole dns for b1
iptables -t nat -I PREROUTING -i br1 ! -d $(nvram get br1_ipaddr) -p tcp --dport 53 -j DNAT --to $(nvram get br1_ipaddr):53
iptables -t nat -I PREROUTING -i br1 ! -d $(nvram get br1_ipaddr) -p udp --dport 53 -j DNAT --to $(nvram get br1_ipaddr):53



In pihole diagnosis it also shows my router 10.10.10.1 has been rate limited
Code:
RATE_LIMIT   Client 10.10.10.1 has been rate-limited (current config allows up to 1000 queries in 60 seconds)


I will attach my current setup which could help to find out the cause.
Sponsor
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3005
Location: Germany

PostPosted: Sun Mar 24, 2024 13:43    Post subject: Reply with quote
WAN down?
_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
rnix
DD-WRT User


Joined: 23 Feb 2016
Posts: 200

PostPosted: Sun Mar 24, 2024 14:12    Post subject: Reply with quote
WAN is not down as I can still resolve all pages until rate limiter kicks in due excessive amount (4000+) or queries.
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3005
Location: Germany

PostPosted: Sun Mar 24, 2024 14:38    Post subject: Reply with quote
Then I don't know, it can't really be a loop...
show a screenshot of the dashboard and query log

the rule does the following....
br0 packets that are not from 10.10.10.254 and are not addressed to dnsmasq are redirected to dnsmasq

br1 Packets that are not addressed to dnsmasq are redirected to dnsmasq

dnsmasq forwards them to the Pi-Hole and the Pi-Hole to unbound and unbound asks the upstream / root server

as said packets from 10.10.10.254 are not redirected so theoretically there can be no loop.

dns querie floods can occur if there is something wrong with the WAN and the upstream DNS servers are not reachable then requests are answered with N/A
These results are not cached and the client keeps asking

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
rnix
DD-WRT User


Joined: 23 Feb 2016
Posts: 200

PostPosted: Sun Mar 24, 2024 14:54    Post subject: Reply with quote
Output the last lines of the pihole.log file (live)

Code:

Mar 24 16:43:41: Rate-limiting www.apple.com is REFUSED (EDE: blocked)
Mar 24 16:43:41: query[A] www.apple.com from 10.10.10.1
Mar 24 16:43:41: config error is REFUSED (EDE: blocked)
Mar 24 16:43:41: Rate-limiting www.apple.com is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[HTTPS] gsp85-ssl.ls.apple.com from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting gsp85-ssl.ls.apple.com is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[A] gsp85-ssl.ls.apple.com from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting gsp85-ssl.ls.apple.com is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[SVCB] _dns.resolver.arpa from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting _dns.resolver.arpa is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[HTTPS] init.push.apple.com from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting init.push.apple.com is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[A] init.push.apple.com from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting init.push.apple.com is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[A] gateway.icloud.com from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting gateway.icloud.com is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[TXT] push.apple.com from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting push.apple.com is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[HTTPS] m.hotmail.com from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting m.hotmail.com is REFUSED (EDE: blocked)
Mar 24 16:43:44: query[A] m.hotmail.com from 10.10.10.1
Mar 24 16:43:44: config error is REFUSED (EDE: blocked)
Mar 24 16:43:44: Rate-limiting m.hotmail.com is REFUSED (EDE: blocked)
Mar 24 16:43:45: query[SVCB] _dns.resolver.arpa from 10.10.10.1
Mar 24 16:43:45: config error is REFUSED (EDE: blocked)
Mar 24 16:43:45: Rate-limiting _dns.resolver.arpa is REFUSED (EDE: blocked)
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3005
Location: Germany

PostPosted: Sun Mar 24, 2024 15:19    Post subject: Reply with quote
And when in the time period was the dns redirection activated?
By the way, you have to click on one of those high bars to get to the query log and see which queries are being queried in bulk.

But I can see from your screenshots that you are using a firmware version that is at least 1.5 years old.

You should update the router firmware and dnsmasq or at least add these options to dnsmasq

Code:
bogus-priv
dns-forward-max=150


and increase the rate limit to 5000-10000
1000 is the limit for a single client, but the router acts as a proxy and there can be 10-100 clients behind one ip address

your dashbord also looks a bit strange, it has blocked 190 queries in 24h ...

that blocks almost nothing

in the other thread you mentioned that you use wireguard.
is DNS routed through the tunnel?

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
rnix
DD-WRT User


Joined: 23 Feb 2016
Posts: 200

PostPosted: Sun Mar 24, 2024 16:26    Post subject: Reply with quote
Well, I don't know what to say, but seems issue was self-resolved after I completely rebooted my pihole and router (which I tried earlier too).

To answer your earlier questions,
Redirection was re-activated just temporarily so I could demonstrate spikes on dashboard. I had to disable it before due to same issue.

I clicked on one of higest bars and tried to look for high amount of same queries which I found from apple devices.
However I could manually cause similar spikes by just navigating to various websites and total queries count shoots up immediately on dashboard.

I'm not sure where it was indicated I run outdated firmware as my router has r55416 Smile
My wireguard Peer DNS Tunnel setting has 10.10.10.1

I will keep monitoring in case issue resurfaces..
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3005
Location: Germany

PostPosted: Sun Mar 24, 2024 16:38    Post subject: Reply with quote
Quote:
I'm not sure where it was indicated I run outdated firmware as my router has r55416


This can be recognized by the fact that the option "Maximum Concurrent Requests" is missing in your dnsmasq settings.

Since this is actually a global option, I don't know why it is missing in your case

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
rnix
DD-WRT User


Joined: 23 Feb 2016
Posts: 200

PostPosted: Sun Mar 24, 2024 17:17    Post subject: Reply with quote
That is strange. Maybe I will do full reset soon just to start from scratch, and hopefully get rid of such oddities Smile
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 3005
Location: Germany

PostPosted: Sun Mar 24, 2024 17:34    Post subject: Reply with quote
CTRL+F5 ?

maybe just a browser cache problem

_________________
Quickstart guides:
use Pi-Hole as simple DNS-Server with DD-WRT
VLAN configuration via GUI - 1 CPU port
VLAN configuration via GUI - 2 CPU ports (R7800, EA8500 etc)

Routers
Marvell OCTEON TX2 - QHora-322 - OpenWrt 23.05.3 - Gateway
Qualcomm IPQ8065 - R7800 - DD-WRT - WAP
rnix
DD-WRT User


Joined: 23 Feb 2016
Posts: 200

PostPosted: Sun Mar 24, 2024 19:32    Post subject: Reply with quote
I tried ctrl+f5 and private window (which should eliminate any caching problem) with no difference. This option is simply not there for my rt-n18u
I can instead use dns-forward-max=150 option you shared earlier and take another look once I go for reset route.
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8 Display posts from previous:    Page 8 of 8
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum