DNS and resolvers
DNS turns a domain such as example.com into an IP address. Yuhaiin can use different resolvers for direct and proxied traffic.
Open DNS under traffic configuration. The current Web UI has Resolvers, Resolver roles, DNS server, Hosts, Custom replies and DNS cache sections.
Resolvers
Section titled “Resolvers”Create an upstream resolver using the supported transport, such as ordinary UDP/TCP DNS, DNS over HTTPS (DoH), DNS over TLS (DoT), or DNS over QUIC (DoQ). Use a server that you trust. Encrypted DNS protects the query in transit but does not make browsing anonymous.
Resolver roles
Section titled “Resolver roles”Choose resolvers for direct and proxied requests and review the bootstrap resolver. Bootstrap is useful when the address of an encrypted DNS server is itself a hostname; the name has to be resolved before connecting to it.
DNS server and FakeIP
Section titled “DNS server and FakeIP”The DNS server accepts DNS queries from compatible clients when enabled. FakeIP can return addresses from a reserved mapping pool rather than the website’s real address; Yuhaiin later recovers the original domain from that mapping.
Use FakeIP only if your inbound/route configuration actually captures connections to those synthetic addresses. The Auto FakeIP Route setting for kernel-managed TUNs can help; see TUN.
Hosts and cache
Section titled “Hosts and cache”Hosts provides explicit mappings/overrides. DNS cache shows or manages cached answers. A stale override or cached entry can make a website fail after its DNS changes.
Diagnosing a DNS problem
Section titled “Diagnosing a DNS problem”- Try resolving the hostname in Network diagnostics.
- Compare a direct resolver with a configured proxy resolver.
- Check Hosts, FakeIP and cache state.
- Compare an IP-only connection with a hostname connection.
DNS success does not guarantee that the selected outbound can reach the resolved IP.
A reproducible DNS check
Section titled “A reproducible DNS check”When a hostname fails, determine whether the failure happens during resolution or after Yuhaiin has an address:
- Pick a known hostname such as
example.com. - Open DNS → Resolvers. Test a resolver against an A query, then an AAAA query. Read the response code, answer records, elapsed time and any error independently.
- Open DNS → Resolver roles and check which resolver the direct and proxy paths use. If an encrypted resolver is addressed by hostname, check the bootstrap resolver as well.
- Look in DNS → Hosts for an override of that hostname, and DNS → DNS cache for a saved answer. Remove a particular stale entry before changing all DNS settings.
- Run Diagnostics → Network diagnostics. If DNS succeeds but the routed HTTPS check fails, inspect the route or outbound rather than repeatedly replacing resolvers.
A successful lookup does not prove that a remote connection can use the returned address. Likewise, a failed IPv6 (AAAA) answer may be expected on a network or resolver without usable IPv6.
FakeIP: the address is intentionally synthetic
Section titled “FakeIP: the address is intentionally synthetic”When FakeIP is enabled, Yuhaiin may return a synthetic address and retain a domain-to-address mapping. The connection must then be captured by a compatible inbound and mapped back to the original hostname. If the connection bypasses Yuhaiin, the synthetic address is not a usable public destination.
The backend’s current default FakeIP address pools use 198.18.0.0/16 for IPv4 and 2001:2::/64 for IPv6. These are benchmarking ranges, not an ordinary remote public proxy server. Their selection avoids an issue where Chromium treats some RFC1918/ULA FakeIP addresses as local-network targets and blocks requests before they reach TUN.
Do not confuse these FakeIP ranges with the TUN interface’s own address or the address of your HTTP/SOCKS listener. They have separate roles.
Advanced: bootstrap, policy and leakage boundaries
Section titled “Advanced: bootstrap, policy and leakage boundaries”An encrypted resolver can still require an ordinary lookup to find its upstream IP. That initial bootstrap lookup should be configured deliberately so it does not depend recursively on the encrypted resolver being initialized.
Yuhaiin exposes resolver contracts for host, transport type, tlsServerName and cache/test results. Resolver roles live in the routing configuration as directResolver and proxyResolver; the Web UI saves and applies them separately from editing an individual resolver.
An encrypted DNS transport protects a query between Yuhaiin and its upstream; it does not imply that every application uses that resolver, or that traffic cannot leave by a direct route. Verify capture at the inbound and the actual route before making privacy claims.
For developer debugging, src/api/resolvers.ts exposes resolver test and cache operations, and src/docs/bypass/resolver/roles.tsx performs a route-config save followed by Apply.
Custom replies
Section titled “Custom replies”DNS → Custom replies defines ordered replies by question name and type before FakeIP, Hosts and routed upstream resolution. The first matching name/type pair wins. Exact names match only themselves; *.example.com matches subdomains but excludes the apex, and * matches all names.
Choose the record type, response code, TTL and answer records. For example, an exact test.example.com A rule can return 192.0.2.1 for a local test. An empty NOERROR answer means no records of that type; NXDOMAIN means the name does not exist and clients may cache it across types. TTL zero requests no caching.
Save validates the rules and atomically replaces the active snapshot; invalid edits leave the previous rules intact. An empty list clears custom replies. These rules change DNS answers, not connection destinations, and do not create reverse/FakeIP mappings. See backend custom reply semantics.