The solution is to ensure that once connected to the VPN, you are using ONLY the DNS server/s provided by the VPN service.
When DNS is managed elsewhere on your computer system or mobile device (i.e. operating system, VPN client), secure DNS set in the web browser could be considered a leak.
The source for DNS leaks in operating systems is often related to the network adapter, like Wi-Fi or Ethernet. Removing static DNS server entries can eliminate leaks.
ipconfig /flushdns
ipconfig /flushdns
To mitigate IPv6 DNS leaks, select Internet Protocol Version 6 (TCP/IPv6) (similar to Step 6 above), select the option to Use the following DNS server addresses:, then enter :: (two colon characters) into the Preferred DNS server field. Using :: for IPv6 is the same as using 0.0.0.0 for IPv4.
sudo killall -HUP mDNSResponder
Note: The sudo command requires your macOS user password and typing it will not echo any characters, so type carefully and press Enter.DNS server addresses often reside in the /etc/resolv.conf file. VPN clients will try to replace the existing system DNS server details with a DNS server associated with the VPN service. Depending on the thoroughness of the VPN client to takeover DNS, leaks might still be present if non-VPN related nameserver entries remain in the /etc/resolv.conf file after the VPN is connected.
Use the dig and/or nslookup commands (if available) in a Terminal to check which DNS server the system currently uses:
View the contents of the /etc/resolv.conf file:
cat /etc/resolv.conf
Use elevated permissions (sudo) with an editor (i.e. nano, vi) to edit the file:
sudo nano /etc/resolv.conf
Use a # (number sign/hash mark/octothorp) at the beginning of a line in the /etc/resolv.conf file to comment out (i.e. ignore) existing DNS details. Add a DNS server of your choice with the nameserver directive:
Note: A.B.C.D is an example to represent a real DNS server IP address.
Some modern Linux distributions use the systemd init system, which might manage DNS in an insistent and persistent manner. Disable this using the following command:
sudo systemctl disable systemd-resolved.service
Re-enable systemd's resolver using:
sudo systemctl enable systemd-resolved.service
Note: A system reboot might be required after disabling/enabling the systemd-resolved service.
As of OpenVPN version 2.3.9, it is possible to prevent DNS leaks by specifying a directive in the configuration file (OVPN or CONF file extension). Edit the configuration file for the server that you are connecting to and add the following on a new line. For more information, see the OpenVPN manual. OpenVPN manual.
block-outside-dns
Make certain the [Interface] section of the WireGuard configuration file includes a valid entry for the DNS directive:
DNS = A.B.C.D
Note: A.B.C.D is an example to represent a real DNS server IP address.