Recently I ran into a frustrating but interesting issue on my Linux machine (Ubuntu 24.04.2 LTS): whenever my VPN’s kill switch engaged (when the tunnel went down for any reason), using sudo became noticeably slow. Eventually, I figured out what was happening and found several ways to fix it. The root of the problem was surprising, at least for me, and I thought it was worth sharing.
Causes Most VPN’s implement a kill-switch as an emergency brake for when the tunnel drops (e.g., WiFi flaps or the VPN process dies). They typically implement an iptables rule1 with the DROP target as the default policy for all outbound traffic (-P OUTPUT DROP), including DNS to your local router and public resolvers.