Fix a Pi-hole that is not blocking ads, or intermittently blocking, on a TP-Link router

If you find that your Pi-hole is blocking ads only intermittently over DNS or not at all, or only with DHCP running, here’s something to try:
First, find your Pi-hole’s IP addresses in the System tab of the Settings page in Pi-hole’s admin panel:

Second, on your Mac, open the Terminal app. At the prompt, type the following and hit Return:
cat /etc/resolv.conf
(If you’re on Windows, entering ipconfig /all in Command Prompt should give you the same info, but I cannot confirm)
You should see something similar to the following appear:

In my case, my Raspberry Pi is successfully attached to the IP 192.168.0.111 (the two nameservers at the bottom) and is blocking ads over IPv4. However, the two IPv6 nameservers above those (in red) do not match the Pi-hole’s IPv6 address listed in the Pi-hole’s control panel. As a result, the router is not using the Pi-hole for DNS over IPv6 and instead sending clients to Google’s DNS at 8.8.8.8/8.8.4.4.
To resolve this issue, log in to your router’s control panel. In my TP-Link router’s panel there is a tab called IPv6 Support. Under IPv6 Setup, there is an option for setting the IPv6 DNS manually:

Add your Pi-hole’s IPv6 address to the primary field, and hit the Save button. Your Pi-hole should now run as expected without having to use the Pi-hole DHCP.