If I look for DNS leaks when using Tor Browser, I find none. For example, if I connect to https://dnsleaktest.com in Tor Browser, using even the most lax of the security settings, the DNS servers that are reported are all completely different than those I usually use from my ISP. In fact, I get the impression that the DNS is provided by the usual DNS service of whatever Tor Exit Node I'm routed through.
In contrast, VPNs on Linux always seem to leak the DNS. Despite testing the advice of numerous different purported solutions (such as this, this and this) I have found none that works, perhaps because the answers to the questions are (or appear at least) to be provided by people who have found ad-hoc solutions rather than by experts in OpenVPN. In particular, no modifications of the relevant OpenVPN config files seems to inhibit leakage of the DNS. Although cursory check with dnsleaktest.com often suggest that the DNS is not being leaked, using the more extensive test that's provided shows that the DNS is actually being served by my regular ISP.
In Windows, the situation is a bit better with regard to using a VPN. The supplied desktop applications of several VPN providers have an option to use their own DNS servers, and no leakage is apparent. Likewise, inserting
block-outside-dns into the relevant OpenVPN config file (under Windows) seems to solve the problem.
Questions: (1) Does Tor itself prevent the DNS leak, or is it the total environment provided by the Tor Browser bundle that prevents it? (2) How is the DNS leakage prevented? (3) Is the method transferable to preventing the DNS leak when using a VPN with Linux?
Just to be clear, I'm not the least bit interested in running Tor in conjunction with a VPN, either before, or after the Tor connection. I'm interested in knowing what, if anything, I can learn from Tor that might be transferable to working with a VPN.