FlClash Get FlClash

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
  1. Why resolving matters
  2. What fake-ip does
  3. Names that mustn't get a fake address
  4. Check for leaks
  5. Also asked

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.

  1. AppWants example.com, asks for its address
  2. FlClashAnswers at once with a fake IP: 198.18.0.5
  3. AppConnects to that fake IP
  4. FlClashLooks the domain up again and picks a line by rule
Fake addresses come from 198.18.0.0/16, a range reserved for testing, so they never collide with real sites.
ModeCharacter
fake-ipFast and accurate for domain rules, the usual choice
redir-hostReturns 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-query

This 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

  1. Start FlClash and turn on TUN.
  2. Search for "DNS leak test" and run any of the sites.
  3. 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

On the same line

Key terms: FlClash DNS settings, what is fake-ip, stop DNS leaks