Speed-up page loading time with pi-hole

Even though you are using pi-hole to stop showing ads which should speed-up page loading since it does not need to featch unwanted ad material.
But sometimes slow down your page loading, since many ads are delivered via HTTPS port 443.

Pi-hole only knows about domain being requested and it is blocking the ad domains on DNS level. It is not aware about the specific protocols used for ad delivery. Slowdown can occur waiting for HTTPS request to timeout to unreachable domain because you have blocked it on DNS level.

To speed things up you could use these three simple iptables rules:

iptables -A INPUT -p tcp -s 192.168.1.0/24 --destination-port 443 -j REJECT --reject-with tcp-reset
iptables -A INPUT -p udp -s 192.168.1.0/24 --destination-port 80 -j REJECT --reject-with icmp-port-unreachable
iptables -A INPUT -p udp -s 192.168.1.0/24 --destination-port 443 -j REJECT --reject-with icmp-port-unreachable

In this case my home network is 192.168.1.0 and all request coming from your local clients to pihole on ports 80,443 are rejected which should hopefully result in speedy page loading.

Save the rules in your local boot script or use iptables-save.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.