This guide is for users who have already connected and want to adjust DNS resolution in Shadowrocket. First, distinguish DNS resolvers from proxy servers. Then use system DNS as a baseline before testing custom DNS or DNS over HTTPS. Finally, repeat queries, check connection logs, and switch networks to verify the results. This helps avoid mistaking rule issues, cached responses, or an unreachable server for a DNS failure.
1. DNS Resolution vs. Website Connections
DNS translates domain names into addresses that can be connected to. When you visit a domain, the browser typically gets an A or AAAA record before establishing a TCP, TLS, or QUIC connection. A successful lookup only means a response was returned; it does not mean the destination is reachable or that the website has loaded. Some proxy protocols resolve the target domain remotely, so you may not see a separate DNS query on your device for every visit.
DNS settings in Shadowrocket determine which resolver handles relevant queries. Global Routing determines how connections are routed. The two are related, but they are not interchangeable. Switching to DoH does not automatically route every website connection through Proxy. Likewise, switching to Proxy alone does not confirm that every DNS request follows the same path.
The steps below use the Home, Config, and Settings layout on iPhone and iPad. First, confirm that the connection works on Home, then open Config to check which configuration is active. On other platforms, check the equivalent settings. Do not assume that lookup results from a desktop terminal reflect what happens on a mobile device.
2. Choosing Between System DNS, Custom DNS, and DoH
System DNS follows the resolver settings provided by the current network. Custom DNS specifies a resolver explicitly, usually by IP address. DoH sends DNS queries over HTTPS. In this guide, “custom DNS” refers specifically to traditional DNS server addresses, to distinguish them from DoH. Technically, a DoH address entered manually is also a custom resolver.
System DNS: Start with a Baseline
RecommendedUse the resolver provided by the current system. Home, office, and campus networks may rely on it for internal domains. The resolver in use may change when you switch networks. It is a good starting point for troubleshooting, but it is not necessarily faster on every network.
Best for: initial troubleshooting, accessing local network resources, and keeping default network behavior
Custom DNS: Specify a Traditional Resolver
Enter a specific DNS server address to compare responses. Using an IP address avoids needing to resolve the server's domain name first, but standard UDP/TCP DNS does not encrypt traffic. The network may also block outbound traffic on port 53.
Best for: when you have a trusted resolver address or need to rule out a system DNS issue
DNS over HTTPS: Encrypt DNS Traffic
Enter the full HTTPS endpoint to send queries to a specific resolver. HTTPS protects traffic between your device and that resolver, but the resolver can still process your queries. The initial connection may require resolving the endpoint's domain, completing a TLS handshake, and validating its certificate.
Best for: when you have a trusted DoH endpoint that is reachable and want encrypted DNS traffic
How to decide: follow the evidence, not the protocol name
If system DNS consistently returns the expected results, leave it in place. Test custom DNS or DoH separately only when you can reproduce an issue with the traditional resolution path or specifically need encrypted DNS traffic. Change one setting at a time.
3. Change DNS in Config and Keep a Way Back
Note the current configuration name, Global Routing mode, and DNS settings. Open Config, select the active configuration, and open its editor or text editor. Check dns-server under [General]. The exact entry may vary by platform, so follow what appears on your screen. Make sure you are not editing a different configuration with the same name that is not enabled.
- Keep the original configuration. Test with a copy or save the original text. If the configuration is maintained at a remote URL, an update may overwrite local changes. Check where the configuration comes from before deciding whether to test on a copy.
- Test system DNS first. Change the existing
dns-servervalue tosystem. Edit it within the existing[General]section; do not add duplicate sections just to insert this line. - Save and reconnect. Return to Config and confirm that the edited configuration is selected. Then go to Home, disconnect, and reconnect. Keep the same default server and Global Routing mode.
- Test another resolver. Remove the value from the current test before entering the next one. Avoid adding several addresses at once during troubleshooting, or it will be difficult to tell which resolver returned the result.
[General]
dns-server = system
The snippet above shows the minimum needed for system DNS; it is not a complete configuration. For traditional custom DNS, replace the value with the IP address of a resolver you have verified. For DoH, enter the service provider's full published endpoint, not its homepage. Do not guess the path from the domain name.
[General]
dns-server = https://example.com/dns-query
If the original configuration also specifies resolvers by domain or contains static mappings under [Host], check those too. Some domains may bypass the default resolver you just changed. Keeping a record of these settings during testing makes it easier to find the cause than deleting the entire section.
4. Check DoH Reachability and Resolution Dependencies
When a DoH endpoint uses a domain name, the client must first resolve that name to an address before it can establish an HTTPS connection. This initial lookup is often called bootstrap resolution. A dependency issue can occur if resolving the endpoint depends on the same DoH service that is not yet reachable. If the request times out, first check whether the endpoint's domain resolves instead of immediately adding more DoH addresses.
- Check the full path:
/dns-queryis common, but not every service uses it. Being able to open the domain does not mean that the specified path supports DoH. - Check HTTPS: Check the device's clock and look for certificate errors. Do not change an HTTPS endpoint to HTTP to bypass the issue or disable certificate validation as a permanent fix.
- Check the network: With the same configuration, test over Wi-Fi and cellular. If one network fails and the other works, investigate network restrictions or the route to the resolver.
- Check routing: Check the actual route used by the endpoint connection. Port 443 alone does not prove that it is going through a proxy.
If a traditional DNS address works but DoH fails, that only shows that the two request paths differ. Possible causes include the HTTPS handshake, certificates, the endpoint path, and access policies. Conversely, if DoH works but traditional DNS times out, that does not mean all traditional resolvers are unavailable. Check the selected address and whether port 53 is reachable.
5. Verify That DNS Changes Take Effect
To verify a change, check whether a new query was sent, what response it returned, and how the website connected afterward. Simply refreshing the same page may hit a browser, system, or client cache. Seeing an IP address alone does not identify the resolver; different resolvers can return the same result.
| Check | What to do | How to interpret the result |
|---|---|---|
| Is the configuration active? | Check the selected configuration in Config, save it, then return to Home and reconnect | A successful edit does not mean the configuration is active; first rule out editing the wrong one |
| Was a new query sent? | Close and reopen the app under test, then look for DNS activity in logs or connection records | If there is no new record, consider caching or resolution handled by the app itself |
| Response type | Check the A and AAAA responses separately for results, timeouts, or errors | An AAAA response with no working IPv6 connection points to a problem later in the connection path |
| End-to-end access | Open the same destination and check the connection address, matched rule, and whether it loads | If resolution succeeds but access still fails, check routing, TLS, and the destination service |
| Retest on another network | Keep the configuration unchanged, switch between Wi-Fi and cellular, and test again | If only one network fails, check its restrictions and connection path first |
First record the results with system DNS, then switch to one custom resolver and repeat the same tests against the same destination. If the interface provides a DNS lookup tool, confirm that it uses the active configuration's DNS settings. A standalone tool that specifies its own server only confirms the result of that particular query.
- Choose a domain that previously failed, and a known working domain to use as a control.
- Repeat each lookup at least three times for every setting. Record whether it succeeds, the response address, and whether the page subsequently loads. Three runs are a troubleshooting sample, not a performance guarantee.
- For
NXDOMAIN, first check the spelling and confirm that the domain exists. For a timeout, check whether the resolver is reachable. ForSERVFAIL, record the response and retest with a control resolver. - After comparing results, restore the stable configuration. A single fast cache hit does not prove that the new resolver is faster overall.
Do not treat nslookup results from a computer as proof that DNS changes took effect on your phone. The two devices may use different networks, resolvers, and caches. If you use it as a supplementary check, record which device ran the query, whether a server was specified, and how that query differs from Shadowrocket's current request path.
6. How DNS Works with Global Routing and Rules
Under Home → Global Routing, Proxy, Direct, Config, and Scene represent different routing modes. When using rules, focus on Config and its contents. Avoid switching modes while troubleshooting DNS; if a page starts working, the cause could be a routing change rather than a different resolver. If you use Scene, also check the settings for the active scene.
In rule processing, DOMAIN-SUFFIX matches domain suffixes. GEOIP and IP-CIDR make decisions based on IP information and may involve DNS resolution. FINAL handles requests that did not match earlier rules. Whether a lookup happens locally also depends on rule parameters and how the proxy handles the request. A domain appearing in a rule does not necessarily mean it is resolved through system DNS first.
[Rule]
DOMAIN-SUFFIX,example.com,DIRECT
IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
FINAL,PROXY
This snippet is for illustrating rule matching only. The first line matches example.com and its subdomains by suffix. In the second line, no-resolve means no extra domain lookup is triggered to match that IP rule. The final line uses PROXY. Do not use it to replace existing rules; your configuration may use a different policy setup.
- The domain matched the expected rule, but the connection to its address timed out: check the destination IP and network path instead of changing DNS alone.
- An internal company domain returns no results with custom DNS: switch back to system DNS for comparison and check whether the company resolver is required.
- The connection comes back soon after you disconnect manually: check the conditions under Settings → On Demand to prevent automatic reconnection from changing the test state.
7. Common Questions and How to Roll Back
Why did switching to DoH make websites load more slowly?
First restore dns-server = system and retest with the same default server and routing mode. The first HTTPS connection for DoH may add latency, and a more distant resolver may return a different service address. Compare lookup time and website connection time separately; do not treat them as a single measurement.
Connectivity Test passed. Why won't a particular domain load?
Connectivity Test only reports the result for its test destination; it does not cover every domain. Check the DNS response for the affected domain separately, then review the rule matched by that request and the destination connection. If only the connection associated with AAAA fails, check the IPv6 path instead of removing all DNS settings.
DNS changes made no difference. Did the settings fail to save?
First confirm the active configuration in Config, then open the text and check dns-server. Save, reconnect, and restart the app under test. If nothing changes, check for static mappings, per-domain resolver settings, and whether the app uses its own encrypted DNS.
Will updating my subscription also fix DNS?
A server subscription and the DNS settings in the current Config are separate. First confirm whether you are updating a server list or a remote configuration. Get subscription links from your service provider. Do not repeatedly replace subscriptions to troubleshoot DNS timeouts, and never post a full link containing access credentials in a public log.
To roll back, restore the configuration you saved earlier, confirm that Global Routing matches its pre-test setting, then reconnect and retest the affected domain. If it works again immediately, keep both configurations and compare their differences. If it still fails, check the current network, server connection, and destination service. Change one variable at a time to get repeatable results.