As discussed here, a DNS leak is where DNS lookups ignore your current routing (in the example of a VPN connection) and still end up going out over your normal internet connection.
This can obviously lead to the anonymity provided by the VPN (in this example) being undermined and thus tools like DNS Leak Test and IP Leak still report your approximate location in addition to which ISP you use, etc.
You can install a DNS forwarder on your VPN server (if you have control of the server where it runs), set it to only forward queries coming from the VPN interface and configure your computer to use it.
You must use two systems: one will act as the router, and route every single connection through the VPN, and the second will use the first as the default gateway.
This is the way Whonix Linux works, so even if the remote site uses WebRTC to find your local address, it will only get the useless local network address (192.168.0.x).
The first method is easier to implement and easier to maintain. The second one is more secure, as it routes everything using the VPN connection.
If the IP packets are able to go outside the VPN tunnel we face a network configuration issue. DNS leak is the situation when you use your ISP DNS servers (or other not trusted DNS) rather than DNS servers from VPN (or other trusted DNS). The problem is that the operating system uses its DNS servers in random order. If you have several network interfaces (WiFI, Network Card, etc) and different DNS server on them then you have no guarantee which DNS server will be used by the operating system. you should use test to be confident https://bash.ws/dnsleak and replace the DNS settings on every interface. The tests you mentioned doesn't test your traffic routes. They shows DNS servers you use. Some people are in panic when they see google DNS in the result of dns leak test, but some people are ok with it.