Domain based VPN tunnelling on LAN

Hey there!

Just got my RPi4 on the mail and I've spent all day configuring Pi-Hole on it, but it got me wondering about tunnelling.

Would it be possible to only tunnel selected domain names through a particular OVPN profile? I have already set Unbound per the official guide, and I have already installed both client and server for OpenVPN.

For example, if 192.168.1.50 wants to connect to contoso.com, only connections to *.contoso.com should be routed through the OpenVPN profile, but if the same device wants to connect anywhere else, it should use the local public IPv4 address instead of the one on the profile.

Welcome to the Pi-hole community, ToasterPC. :slight_smile:

Redirecting your network traffic is not at all related to Pi-hole.
It would have to be done by your router or some piece of software that deals with routing, likely involving your VPN as well as some firewall configuration.
I'd suggest to focus your research on your VPN manufacturer's/provider's documentation and forums for a solution.

However, if you are instead just looking for a way to query specific name servers for specific domain names, GEOIP + DNS multiple resolver - #4 by Bucking_Horn may point you to a solution.