Hi - I have been having this problem for a while now, and I think it is being caused by pi-hole. But i'm really not sure.
Every once in a while (read: completely randomly), it will take FOREVER to load a webpage. Sometimes one I visit every day, sometimes a brand new one.
What I mean by this is I will type in a web address, hit enter, and the browser will just say "waiting..." in the status bar in the bottom left...for almost 2 MINUTES sometimes! and then finally load the entire site in a flash. E.g. blank page for 30s to up to 2 minutes or even a time out....and then finally it makes the connection and loads the page quickly like my usual web browsing experience.
The problem started to seem like DNS resolution because in my previous experience when a page hesitates like that, it usually means the DNS request failed and it is waiting for NXDOMAIN but never receives it, or fails trying the second server or something. I don't understand DNS so forgive me. But you sort of get what I'm saying. I hope.
I couldn't tell why this is happening. At first I thought it may have to do with my wifi, but It happens on a wired connection too, so wifi theory was out. Then I started doing some network recordings with my web inspector in firefox and it was hinting the problem was DNS.
screenshot:
also ran this tool...raspberry pi (@ 10.10.2.24) was at bottom
What is interesting is that I mostly have this problem within Firefox. I tried to access the same page in Chrome when this was occurring one time, and Chrome loaded the site rather instantly. Maybe a slight pause (0.5s) in DNS.
I have tried disabling DNS over HTTPS in Firefox, but results seem the same. I believe I also tried disabling uBlock/adblock & other extensions but results seemed the same. I will run these tests again.
What HAS changed on my network recently (last 6 months) was enabling of IPv6. I should probably disable it and run tests but it was so complicated to enable on my router that I don't want to do that right now...I will though and update this post. Just super late and wanted to get this out there for some initial feedback.
I saw the forum post that said there was issues with IPv6 and pi-hole...but only for versions <4.0. I am running
- Pi-hole v5.13
- FTL v5.18.2
- Web Interface v5.16
on Raspberry Pi 3 Model B Rev 1.2 running Raspbian GNU/Linux 10 (buster)
Problem occurs on Mac and Windows and mobile devices.
I tried setting manual DNS to my router (10.10.2.1) to bypass Pihole...but sometimes it had the same long delay without using pihole too...I think...
The problem is so random and esoteric it's hard to document.
I'm just really confused. I was coming here with hopes someone could tell me where/how to start troubleshooting.
EDIT: I just realized I actually had IPv6 disabled on my Mac when the problem occurred, inspiring this post. If that's useful additional info. So it seems to occur whether I'm using IPv6 on my client machine or not.
edit: some more info from scutil --dns
...I think i've been using my ISP IPv6 resolver this whole time...Is that what this means? This is the IPv6 address of my pi.hole
DNS configuration (for scoped queries)
resolver #1
search domain[0] : ubnt.lan
nameserver[0] : 2600:1700:b2e:205f:25bb:40e:ff:7430
nameserver[1] : 10.10.2.24
nameserver[2] : 10.10.2.1
if_index : 14 (en0)
flags : Scoped, Request A records, Request AAAA records
reach : 0x00020002 (Reachable,Directly Reachable Address)
even though it's listed last?
and pihole is configured for cloudflare?
PIHOLE_DNS_1=1.1.1.1
PIHOLE_DNS_2=1.0.0.1
PIHOLE_DNS_3=2606:4700:4700::1111
PIHOLE_DNS_4=2606:4700:4700::1001
PIHOLE_DNS_5=10.10.2.1
And Windows devices don't even seem to be receiving IPv6 DNS info?
Expected Behaviour:
Page loads without delay / instantaneously
Actual Behaviour:
Connection to page takes forever to establish, up to two whole minutes sometimes, then page loads instantly thereafter or, in some cases, times out entirely.