What is a DNS leak and how to fix it

Father

Professional
Messages
2,604
Reputation
4
Reaction score
622
Points
113
Article content:
  • What is a DNS leak and what is the danger
  • How to check for a DNS leak on your device
  • Reasons and how to protect yourself from DNS leaks
    • Incorrect proxy server configuration
    • Using untrusted DNS servers
    • Viruses or using unsafe apps
    • Using a transparent proxy
  • Top 3 Secure DNS Services
    • OpenDNS
    • Cloudflare
    • Google Public DNS
  • Conclusion

Internet security comes first. We don't like it when our privacy is interfered with, we want to remain anonymous in front of providers, make purchases online, use social networks without fear that passwords and bank details will be intercepted by scammers, even when we connect via public Wi-Fi access points in cafes or shopping centers. To do this, we use proxy and VPN services, and set up secure DNS servers.
In practice, even when we think that we are protected, we may encounter a DNS leak, which negates all the efforts made. Why does this problem occur and why is it dangerous? How can I protect myself and remain anonymous on the Internet? About everything in more detail below.

What is a DNS leak and what is the danger​

A DNS leak (Domain Name System) is a situation where your device unexpectedly sends DNS requests through servers that differ from the ones you set in the network hardware settings. When using a VPN or proxy, traffic will not go inside a secure tunnel, but will bypass it, using a regular ISP channel to DSN servers assigned by the provider or operating system.
For those who are not familiar with the topic, a small digression, what is DNS and what is the connection with VPNs and proxies.
We are all used to entering domain names in the browser's address bar in the usual text format, for example, google.com. However, network equipment redirects traffic using numeric IPv4 IP addresses like 192.168.0.1 or text-numeric IPv6 addresses that look like this: 2018:0ab6:84a2:0000:0000:7a2b:0271:7435. The domain name system or DNS is used to convert a human-friendly text site address to a machine-readable IP address.
How DNS works is easy to explain if you compare it with a phone directory. Only instead of numbers, surnames, and city streets, it contains interpretations of the domain name in IP. This is what our device accesses every time we enter the site address in the browser's address bar.
The problem is that DNS queries are not encrypted, even if the site you are connected to encrypts traffic over HTTPS. Therefore, any activity on the Internet leaves a trace: the provider or hackers can see your browsing history when you connect to Wi-Fi in public places. Even more dangerous, your IP address and ports become available to the owners of the site you visited. This information is enough for fraudsters to intercept the packets you send.
For anonymity on the Internet, VPNs and proxy servers are used.
Proxy — in computer networks, this is an intermediate server between the target site and the user. When using proxying, your computer establishes a connection to the intermediary server and routes all traffic, including DNS queries, not directly, but through it. At the same time, any activity on the Internet is performed not on your behalf, but on the” name " of the remote server, while information about you remains hidden for the target site. The technology is used to change the IP address. HTTPS and SOCKS5 proxies encrypt traffic between you and the server, also hiding the request history from the provider and from hackers trying to intercept traffic.
VPN is an alternative method of anonymization. A virtual network with Internet traffic encryption is deployed on top of the main connection. Data is routed through a secure tunnel to a remote server, which actually acts as a firewall. The provider can't see what information is transmitted inside the secure channel, and it doesn't see the DNS query history (in fact, only one connection to the remote server is established). What is important is that complete anonymity is maintained on the Internet — a different IP address of the VPN service is transmitted to the DNS servers and as a result, the sites visited are transferred.
A private proxy with encryption provides better traffic protection. Elite private proxies even reduce latency (ping) by filtering traffic from spam and using caching.
But using anonymization, whether it's a proxy or a VPN, doesn't guarantee complete security. A DNS leak, when traffic goes not through a secure and confidential channel, but directly, is one of the possible problems that can compromise your online security.

A DNS leak can cause several problems at once:
  • providers or attackers who have gained access to the DNS server can view your browsing history, despite the use of anonymizers;
  • traffic is not encrypted and it, along with bank card data, usernames and passwords, can be intercepted by a hacker when connecting to Wi-Fi in public places.

How to check for a DNS leak on your device​

To check whether there is a leak when using a proxy or VPN, you need to select an online service for detecting testing and run the test twice: the first one without the anonymization tool, the second one with the proxy or VPN enabled, and then compare the results. They must be different, which will indicate that DNS requests are being redirected.
Let's look at the example of the site "DNS leak test".
  1. First, go to the site and run the check with the proxy or VPN turned off.
    bphh8kr4q373ziy9sa58oaenf6h21sbf.png
  2. We get a result like this:
    xb703ox536o4cf1ql4kxyoguhegkcbyf.png
  3. Now enable the proxy. We will proxy the entire Windows OS so that traffic is redirected through the IP address we need.
  4. Opening the DNS leak site test.com again and run a second check. We get this result::
    vmd5n4jpprpamvp0th0mttwok1sfhtub.png
We see that the IP addresses do not match in the results, which means that there is no leak.

Reasons and how to protect yourself from DNS leaks​

Most often, users of desktop computers and laptops with the Windows operating system face DNS leaks. Although the problem can affect everyone, regardless of the device type and OS.
Common causes of DNS leaks and how to fix the problem:

Incorrect proxy server configuration​

Most often, a DNS leak occurs due to errors in the proxy configuration or the DNS server that uses the proxy. Also, various proxy clients can use their own DNS settings, bypassing the proxy settings, which causes data leaks. Another common reason is when the proxy does not support DNS protocols (for example, UDP). In this case, DNS queries can bypass the proxy and be sent directly.
How can I solve the problem? Using proxy-supported protocols and enabling appropriate DNS filters can help reduce the risk of leaks. If you find a leak, try configuring your network connection or router manually and install a reliable DNS server.
You can change or set a permanent DNS server address in the router settings in the DHCP section (primary and secondary DNS fields).

You can also specify DNS in the network connection settings. On Windows for this:
  1. Open "Settings“, go to the”Network and Internet" menu.
  2. In the "Status" tab, select the "Configure Adapter Settings" menu.
  3. Select a network adapter or virtual connection, right-click on it, and select “Properties”from the menu.
  4. In the list of components, find the line Internet Protocol TCP IP v4, mark it by clicking the left mouse button. Then click on the "Properties" button. Enter the DNS address in the settings.
The DNS configuration principle is similar in iOS, Android, Linux, and Mac. You need to go to the network device settings and edit the DHCP or TCP/IP settings.

Using untrusted DNS servers​

Some Internet service providers forward all user requests through their DNS servers, but often do not ensure their security. Attackers are looking for vulnerabilities and can intercept user requests by redirecting them to fake phishing sites. A similar problem occurs with third-party public services.
Use secure DNS servers that support DNSSEC technology to solve the problem. For example, OpenDNS, Google Public DNS, or Cloudflare. If you are using a VPN, specify the static DNS servers provided by the VPN operator in the Wi-Fi router settings (in the DHCP section).

Viruses or using unsafe apps​

Viruses and programs with malicious scripts can change the device's network settings and redirect DNS requests to fake servers. As a result, your online browsing history may be exposed. But the big danger is that servers can redirect you to fake phishing sites instead of real ones, which will steal your usernames, passwords, bank card details and payment systems. A similar problem with DNS is also possible on Android and iOS.
To avoid this problem, check your system regularly for viruses and update your operating system. Periodically check for DNS leaks and which servers your computer or smartphone is accessing.

Using a transparent proxy​

Transparent DNS Proxy involves installing a proxy at the local network level and redirecting all traffic through the proxy server without additional configuration of the network card or client installation on users ' devices. Using a transparent proxy often leads to DNS leaks. And sometimes this technology is used by providers to collect information about the sites that customers visit.
If a transparent proxy is used, DNS requests will be redirected directly through the provider's servers, even if static DNS servers are specified separately, a separate proxy connection is established, or DNS filters are used.

The simplest solution to this problem is to buy elite proxies with traffic encryption. If a DNS leak still occurs due to network settings, you need to change the network hardware configuration:
  • prohibit connection via port 53, which is used when using Transparent DNS Proxy technology, in the firewall rules, and forward it to another port, for example, 5353;
  • To set a static DNS, for example, you can use Google's public servers: primary - 8.8.8.8, and secondary-8.8.4.4.

Top 3 Secure DNS Services​

You can change DNS at any time on any network device: laptop, router, smartphone, tablet, even SmartTV. How to set up DNS for this purpose-we will consider further. Choose secure DNS services that guarantee your security and help you improve your connection speed. There are many reliable DNS servers. The following three are the safest.

OpenDNS​

The DNS service, launched by Cisco in 2005 — is a leader in the information security and network technology segment. This is a free server with features that are not available for many paid services.
Free OpenDNS DNS Servers:
  • Primary DNS - 208.67.222.222
  • Secondary DNS - 208.67.220.220

Dignities:
  • blocks phishing sites;
  • high processing speed;
  • reliable data protection, no hacking.
In the paid pricing plan, you can view the history and configure filtering with blocking specific resources or sites by the specified rule.

Cloudflare​

According to independent DNSPerf testers, Cloudflare is the fastest DNS service in the world. The service pays attention to data protection and privacy. It doesn't store user session history.Logs are deleted every 24 hours.
  • Main address: 1.1.1.1

Additional servers are also running:
  • with built-in filtering of malicious sites: 1.1.1.2/1.0.0.2;
  • with filtering sites with 18+ content: 1.1.1.3/1.0.0.3.
Advantages: simplicity, speed, built-in protection against DDoS attacks. Provides a Wrap application that protects against DNS leaks on Mac, Android, iOS, and Windows.

Google Public DNS​

Perhaps the most famous public DNS. Google pays attention to all its services. Google Public DNS is a secure and fast server, data protection and compliance with privacy rules. It doesn't collect user location data.It deletes logs with the request history every two weeks.
Google Public DNS Servers:
  • 8.8.8.8
  • 8.8.4.4
Dignities: high security, fast data processing.

Conclusion​

DNS leak protection requires a comprehensive approach. It is important to monitor security and install applications from trusted sources (at least, check the software with an antivirus before unpacking the archive and installing it). Use trusted proxy and VPN services, as well as secure DNS servers that use modern encryption technologies and protect user data.
 
Top