I'm using pihole as my primary DNS server but in a second 'layer', that is, I use bind9 for local DNS resolution and it queries pihole for everything else (internet).
The problem is I'm getting rate_limit error for the host running bind9.
Is there a way to 'whitelist' this IP (bind9 host) and keep the limit for every other device in my network?
In that scenario, your BIND server is aggregating DNS traffic of your entire network and forwarding the bulk of it (i.e. all non-local requests) to Pi-hole.
Pi-hole will see all DNS traffic as originating from your BIND server machine's IP address. As BIND is Pi-hole's only client, Pi-hole won't be able to attribute DNS requests to individual clients, and you won't be able to apply client-specific filtering.
You have a choice of adopting the rate limit to accommodate for your aggregated DNS volume, or you could rearrange your DNS resolution chain:
Have your clients use Pi-hole exclusively for DNS and enable Pi-hole's Conditional Forwarding to your BIND server.