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.

Server side solution to stop redirect from http to https in Chrome

If you have configured your main web site domain to use SSL for example https://your.domain and https://www.your.domain and you have other sub-domains that you access without SSL you could face an issue where Chrome browser insists to use HTTPS on your sub-domains as well. This can cause problems accessing your sub-domain if it is not using SSL.

Even if you manually type http://subdomain.your.domain it will automatically redirect you to https://subdomain.your.domain Continue reading “Server side solution to stop redirect from http to https in Chrome”