DNS, fake-ip and leaks
Names are resolved before anything connects. That explains why a page can fail even with the proxy on.
Checked against FlClash 0.9.5
On this page
Why resolving matters
Before opening a site, the system turns its name into an IP. If your local provider does that, you may get a wrong address, or they learn where you're going. The second is called a DNS leak.
What fake-ip does
FlClash doesn't wait for a real answer. It hands the app a fake address, then looks the name up again when the app connects. The app notices nothing, and the real lookup happens at the node.
- AppWants example.com, asks for its address
- FlClashAnswers at once with a fake IP: 198.18.0.5
- AppConnects to that fake IP
- FlClashLooks the domain up again and picks a line by rule
| Mode | Character |
|---|---|
| fake-ip | Fast and accurate for domain rules, the usual choice |
| redir-host | Returns real IPs, for the odd program that needs them |
Names that mustn't get a fake address
Local device names, time servers and the system's connectivity check break with fake addresses, so list them in fake-ip-filter. 0.9.5 already adds the Windows check to the default list.
dns:
enable: true
enhanced-mode: fake-ip
fake-ip-filter:
- '*.lan'
- 'time.*.com'
nameserver:
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-queryThis goes in an override. The two servers are Chinese public DNS, good for names you reach direct. Replace them with ones you trust.
Check for leaks
- Start FlClash and turn on TUN.
- Search for "DNS leak test" and run any of the sites.
- If your local provider shows up, it leaks. If you see only the node's location or your own DNS, it doesn't.
A browser's built-in secure DNS bypasses FlClash. Turn it off for the test.
Also asked
Pages fail for a while after I quit FlClash.
The system has cached fake addresses. Wait a minute or two, or clear the cache: ipconfig /flushdns on Windows.
The system says "no internet" but it works.
The connectivity check got a fake address. Update to 0.9.5 or add the name to the filter.
Read next
Using itRouting you can maintain, with rule providersThousands of copied DOMAIN-SUFFIX lines go stale in months. Three self-updating rule sets leave you with five lines.
Using itSend the terminal, Git, Docker and WSL through FlClashThe browser works but git clone hangs. Every tool reads its proxy from a different place. Here they all are.