Fake-IP vs. Redir-Host: Clash DNS Modes Explained for Windows 11
Learn how Clash Fake-IP uses reserved addresses to answer DNS queries and match rules by domain, how Redir-Host differs, and which domains to add to fake-ip-filter.
First, understand DNS modes, TUN, and outbound rules
In a mihomo configuration, dns.enhanced-mode determines how the built-in DNS server answers applicable queries. Fake-IP can return an address for internal mapping; Redir-Host returns the resolved address. This setting does not enable a proxy for an app or make its connections go direct. TUN controls which IP traffic enters the core; in rule mode, rules determine which outbound handles each connection.
On Windows 11, when a browser sends HTTPS traffic through an HTTP proxy using CONNECT, it can pass the destination hostname directly to the proxy. In that case, the core may receive the domain even without a Fake-IP mapping. By contrast, if an app resolves the hostname itself and then connects directly, the core may see only the destination IP. This is why the difference between the two modes is more noticeable with TUN.
Fake-IP: Return a mapped address, then recover the domain from it
This example uses an IPv4 A-record query. 198.18.0.1/16 is a commonly used fake-ip-range value within 198.18.0.0/15, a range reserved for network benchmarking. The actual response depends on your current configuration. Addresses from the pool are not the website's real IP addresses.
- An app queries
www.example.com. The query reaches mihomo's built-in DNS server, and the domain is not on the exception list. - The core can assign an address from the pool, such as
198.18.0.23, store its association with the domain, and return it to the app. It does not need to obtain the website's actual A record first. - The app connects to
198.18.0.23:443. If the connection comes back to the same core through TUN or another entry point, the core can use the mapping to recoverwww.example.com. - In rule mode, the core checks rules from top to bottom. Domain rules can match the recovered hostname. For rules that require the destination IP, the core may still perform a real DNS lookup. If the connection ultimately goes direct, it uses the actual destination address—not an address from the pool.
Fake-IP preserves the domain name as a routing clue. A single CDN address can serve multiple websites, so the destination IP alone may not reliably identify the site. The mapping helps the core recover the domain the app originally queried. Fake-IP is not a universal speed boost: the initial DNS response may arrive sooner, but real DNS resolution, proxy handshakes, and connecting to the destination still take time.
This flow depends on two things: the app's query must pass through the built-in DNS server, and the connection to the mapped address must return to the core. If the app uses its own encrypted DNS, domain rules may not match. If TUN is off while the app still has a mapped address cached, the connection may time out. Adding the same filter entry will not fix both issues.
Redir-Host: The app gets the real address; domain visibility depends on the connection path
Redir-Host returns the resolved address to the client. The result may come from cache; if an upstream lookup is needed, the app must wait for the DNS response before connecting. Apps that read DNS addresses, check subnets, or pass results to another device often work more naturally with this mode. The returned address is not necessarily public—a corporate or home DNS server can return a private address too.
| Comparison | Fake-IP | Redir-Host |
|---|---|---|
| A record returned to the app | Usually a mapped address from the pool; filtered domains can receive the real address | The resolved address |
| Where the domain comes from for transparently intercepted connections | The queried domain can be recovered when the connection matches a mapping | Depends on available clues, such as DNS associations and protocol sniffing |
| What to check when troubleshooting | Whether both DNS queries and connections reach the core, and whether the address pool overlaps with other routes | Whether the response came from the expected upstream, and whether the connection retains a domain for rule matching |
Switching to Redir-Host does not make every domain rule stop working. An explicit proxy connection may already include the domain, and enabled, applicable protocol sniffing may also reveal it. However, domain-based decisions can be unreliable for IP-only connections, traffic where the domain cannot be determined, or multiple domains sharing the same address. Check the rule actually matched on the client's Connections page or in the logs instead of relying only on whether a webpage loads.
Which domains to add to fake-ip-filter
- Local services that rely on real addresses. For example, home DNS may resolve
printer.home.arpato192.168.1.40, and a printing utility may read the result to check whether the printer is on the local network. Try filtering just this domain, and confirm that the query is answered by the home DNS server that can resolve it. - Business apps that check IP ranges. For example, an app may refuse to start unless its server address is within
10.20.0.0/16. Add a specific exception for the confirmed service domain, then check the corporate DNS policy and the TUN route to the corporate network. A public DNS resolver may not return the correct record. - Control software that passes addresses to another device. If a program sends the IPv4 address returned by DNS to another device, that device cannot translate it back to the destination unless it shares the same core's mapping. Filter only the service domains that need to be passed along; there is no need to exempt every domain the app accesses.
Add specific domains to the active configuration
This is an excerpt from mihomo's dns section, not a complete subscription. Merge the entries into your existing list and keep its upstreams, resolution policies, and filters. Do not add a second top-level dns: key to the same YAML file. This example assumes the current filter list uses a blacklist; if your configuration uses an allowlist or rules, edit it according to that approach instead of appending these entries as-is.
dns:
enable: true
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
fake-ip-filter-mode: blacklist
fake-ip-filter:
- 'printer.home.arpa'
Filtering changes only how DNS answers are returned; it does not choose an upstream DNS server or an outbound policy. For private domains, check whether nameserver-policy routes queries to the right internal DNS server. Whether a connection goes direct depends on the rule and route that actually match. If the issue involves .local device discovery, distinguish regular DNS from mDNS, which uses UDP 5353: adding a filter entry will not restore multicast discovery if the query never reaches the built-in DNS server.
If your configuration comes from a subscription, edits to the generated file may be lost on the next update. If your client supports overrides, use one to maintain local exceptions. After saving and reloading, check that the active list still includes the subscription's original entries. How lists are merged varies by client.
Verify on Windows 11: Check the DNS response, then the connection rule
- Note the current settings before making changes. Check the active mode, whether TUN is on, and whether the affected app uses the system proxy. In Windows, go to Settings → Network & internet → Proxy to view system proxy settings; this does not tell you whether TUN is enabled. For initial setup, see the Getting Started guide.
- Compare queries for the same domain. The commands below use PowerShell to query an A record and inspect IPv4 routes. Replace the printer hostname with the domain causing the issue. These commands show this system-level query; they do not guarantee that a browser or another app uses the same DNS path.
Resolve-DnsName -Name www.example.com -Type A -DnsOnly
>Resolve-DnsName -Name printer.home.arpa -Type A -DnsOnly
>route print -4
- Check the results and routing. If a regular test domain's A record falls within the configured Fake-IP pool, this query received a mapping. If the printer domain is filtered, it should return the address currently provided by your internal DNS server. If the app gets a mapping but the connection times out, check whether the destination route sends traffic to TUN—especially if another VPN or a manual static route is also enabled.
- Clear the cache, then retry the app. After changing and reloading the configuration, run
ipconfig /flushdnsin a terminal to clear the Windows DNS client cache, then fully quit and reopen the affected app. This command does not clear the app's own DNS cache. If command-line results look right but the app still fails, check its secure DNS settings and compare the domain, destination IP, and matched rule in the client logs. - Compare modes if needed. Keep a copy of the original configuration, change only
enhanced-modetoredir-host, and leave TUN, upstream DNS, and outbound rules unchanged. Reload, clear the cache, then test the affected app and a domain that previously split correctly by domain. If compatibility improves but domain-based routing gets worse, switch back to Fake-IP and keep only the specific filter entries you've verified.