realfp.com

What is a DNS leak?

What is DNS?
DNS, which stands for “Domain Name System,” is a distributed database that provides translation services between hostnames and IP addresses. On the internet, every computer has a unique IP address, just like every person has a unique identification number. However, IP addresses consist of a string of numbers, such as 192.168.1.1, which are not easy for humans to remember. Therefore, a method is needed to convert these numbers into more memorable names, which is the primary function of DNS.

For example, when you type www.google.com into your browser, your computer first sends a request to a DNS server, asking for the corresponding IP address of this website. The DNS server will reply that the IP address for www.google.com is 64.233.170.113. Then, your computer sends a request to this IP address to retrieve the web page content. In short, a DNS server is like the internet’s “phone book,” helping us find the “phone number” (i.e., the IP address) of each website.

How does DNS work when changing an IP?
When you use a VPN or proxy server, in theory, all your internet traffic—including DNS requests (i.e., the names of the websites you visit)—should be transmitted through the VPN or proxy server. This process typically involves the following four steps:

1. Your computer tells the VPN or proxy server that you want to visit google.com.

2. The VPN or proxy server sends a request to its own DNS server: Give me an IP address for a Google server.

3. The DNS server returns an IP address for a Google server.

4. The VPN or proxy server accesses Google using the returned IP address.

Suppose a user in Singapore uses a VPN or proxy server with a US IP address to visit a website. If their VPN or software is configured correctly, the detection result should be: the DNS server's IP address should also be located in the United States, consistent with the IP region of the VPN or proxy server. If the DNS server is not in the US, for example, in Canada or another region, there is no need to worry—at least the user's real location (Singapore) has not been leaked.

What is a “DNS leak”?
Even if your internet traffic is routed through a VPN or proxy server, your device might still use your Internet Service Provider’s (ISP) DNS servers instead of the ones provided by the VPN or proxy service. As a result, your IP address and DNS requests (i.e., the names of the websites you visit) could be exposed to your ISP. This is what is known as a “DNS leak.”

For example, a user in Singapore uses a US proxy IP to visit Google, but due to incorrect VPN or software configuration, their device requests Google's IP address from a local DNS server in Singapore. At this point, the user's ISP knows they are visiting Google. When the user checks for a DNS leak, they will find that the IP region of the DNS server matches the region of the user's real IP (both in Singapore), which means a DNS leak has occurred!

Risks of a DNS Leak
If a DNS leak occurs, your DNS requests will be sent to your ISP's DNS servers instead of the VPN's DNS servers. This means:

Real Location Exposed: Your ISP can see your IP address, thus exposing your actual geographical location.

Personal Privacy Leaked: Your ISP may log the websites you visit and use this information for targeted advertising or sell it to third parties.

Increased Security Risks: Some malware or cyberattacks might alter your DNS settings, causing your DNS requests to be sent to insecure DNS servers. Insecure DNS servers can redirect your requests to malicious websites, a technique known as DNS hijacking. For example, you might intend to visit your bank's website but get redirected to a fake banking site. This fake site may look identical to the real one but is actually set up by cybercriminals to steal your username and password.

How to Prevent DNS Leaks
Use a Reliable VPN/Proxy Service
Some VPN or proxy service providers offer features to prevent DNS leaks. These VPNs or proxies ensure that all your DNS requests are routed through their servers, not your ISP's. When choosing a VPN or proxy service, you should check if they provide DNS leak protection.

Use Secure Public DNS Servers
You can manually change the DNS servers in your device's network settings to secure public DNS servers, such as Google's Public DNS (8.8.8.8 and 8.8.4.4) or Cloudflare's DNS (1.1.1.1). This way, even if your VPN connection drops, your DNS requests will not be sent to your ISP's servers.

Use a DNS Leak Test Tool
Before visiting websites with a VPN or proxy server, you can use a DNS leak test tool to check for any DNS leaks. Regular testing is a good habit to ensure your privacy and security.

Conclusion: DNS leaks are a common security risk when using a VPN or proxy, potentially leading to the exposure of your real IP and a breach of privacy. By choosing a reliable VPN service, configuring secure public DNS servers, and performing regular leak tests, you can effectively prevent this risk and protect your online security and personal privacy.