Many problems such as "Connected but some websites cannot be opened", "Video websites always jump to strange regional versions" and "Domestic websites become very slow" are all rooted in DNS. There are only two boxes related to DNS in v2rayN - remote DNS and domestic DNS - but why you need to fill in two and what to fill in respectively is worth spending five minutes to figure out. After configuration, a large number of strange problems can be avoided.

1Why two sets of DNS are needed

DNS is responsible for translating domain names into IPs. The trouble is:

  • foreign domain name If you leave it to the operator for DNS resolution, you may get a contaminated wrong IP - this is the classic reason why certain websites cannot be opened even though the proxy is open.
  • Domestic domain name If you leave it to overseas DNS resolution, it will be pointed to a CDN node far away from you, and the domestic website will slow down.

So the correct posture is division of labor: Domain names that are proxied use overseas DNS resolution, and directly connected domestic domain names use domestic DNS resolution.. The DNS settings of v2rayN are designed around this division of labor. Routing offload It's a pair.

2Where to fill in and what to fill in

Open "Parameter Settings" → "DNS Settings", two key locations:

  • Remote DNS (proxy side): fill in https://1.1.1.1/dns-query(Cloudflare's DoH) or 8.8.8.8(Google). DoH is an encrypted query and is inherently resistant to interference, so use it first.
  • Domestic DNS (direct side): fill in 223.5.5.5(Alibaba) or 119.29.29.29(Tencent), which is more stable than following the operator by default.
Parameter Settings—DNS Settings
Core basic settings Core routing settings DNS settings GUI settings Remote DNS (for proxy domain names) https://1.1.1.1/dns-query Domestic DNS (for directly connected domain names) 223.5.5.5 After the changes are completed, click OK and restart the service to take effect. After the changes are completed, click OK and restart the service to take effect. OK Cancel
The two boxes perform their own duties: overseas domain names are handed over to the remote DNS, and domestic domain names are handed over to Alibaba/Tencent's public DNS.

Most common mistakes: Fill in the remote DNS with an address that cannot be connected locally, or fill in the wrong one with your finger. The symptom of a full DNS failure is "no website can be opened, but the node speed test is normal." Remember the original value before changing it, and change it back if there is a problem.

3Doesn't the change take effect? Two switches and one action

  • Restart the service: DNS belongs to the kernel configuration. Click OK to reload the kernel. The most direct way is to reselect the current node or restart v2rayN.
  • System DNS cache: Windows itself also has a layer of cache. After changing the DNS, when certain domain names are still resolved to the old IP, the administrator can run ipconfig /flushdns Clear it.
  • Browser secure DNS: Chrome/Edge's "Use Secure DNS" will bypass the system settings and check it by itself. When testing, turn it off first to eliminate interference.

4DNS in Tun mode

Opened Tun mode Afterwards, all system traffic (including DNS queries) is taken over by the kernel. The DNS configured here will be used as a global resolution entry, and the effect is more thorough than the system proxy mode. If you are repeatedly tortured by DNS problems, opening Tun will often solve the problem.

5By the way, let's talk about DNS leaks.

DNS leakage refers to: the traffic goes through the proxy, but the domain name query still goes out from the local operator - what domain name you visit, the local network can clearly see. If you want to know if you have missed anything, connect to the proxy and visit dnsleaktest.com Click Standard Test: If the server of your local operator appears in the results, it is missing. The solution is in order of priority: Change the remote DNS to DoH (the one starting with https) → turn on Tun mode. After testing again, all you see should be the DNS servers on the node side.

DNS is just one of the reasons why it "can't be opened". If the problem persists after following this article, go back to General troubleshooting for being unable to access the Internet Go through the other sections in order.

Download v2rayN (Windows version)v7.22.6 · Support x64 / ARM64 · Open source and free