The Goal

I am often connected to a split horizon VPN connection, meaning only traffic destined for the farside of the VPN is routed across it. Local and internet destined traffic is routed like normal.

However, in my particular situation this causes an issue with my local DNS setup. When I’m not connected to the VPN my DNS resolves using my Red Hat Identity Manager servers which serves a LAN.LOCAL zone for my home hosted services. When I am connected to the VPN my DNS resolution is changed to use a DNS server on the farside of the VPN connection and none of my LAN.LOCAL services are resolvable.

In some situations, such as if your infosec team wants all traffic to cross the VPN when connected, this is exactly what you want. However, I am not in one of those situations.

The Fix

MacOS Sonoma allows you to setup local conditional DNS forwarding my creating a simple file in /etc/resolver/. Here is the configuration file I created called /etc/resolver/home.lan:

domain home.lan
search home.lan
nameserver 192.168.100.21