Shadowrocket’s DNS settings determine how domain names are resolved; they do not select the route used for a connection. This guide is for users with a working connection who want to adjust DNS: first understand system DNS, standard custom DNS, and DoH; then check for overrides in the active Config; finally, test one setting at a time. Get any existing subscription from your service provider. This guide does not cover choosing a provider.
What DNS Does: Separate Name Resolution from Connectivity
When you open a website, an app usually resolves its domain name to an IP address before connecting. A successful DNS lookup only means an address was returned. You still need to check whether the destination port is reachable, the TLS handshake succeeds, and the route selected by your rules works. Conversely, an existing connection or cached result may keep some sites working temporarily; that does not prove all DNS queries are working.
The sequence above shows a common local resolution process. It does not mean every proxy connection resolves the domain on your device. Some connections pass the destination domain to a remote server, and some apps use their own resolution logic. Check what happens to the actual request; changing one setting in Settings does not replace DNS uniformly for every app and connection.
Three DNS Options: System, Custom, and DoH
System DNS uses the resolver provided by the current network, so the actual resolver may change when you switch between Wi-Fi and cellular. Custom standard DNS lets you specify a resolver address directly. DNS over HTTPS (DoH) sends DNS messages over HTTPS. It changes how queries are transported, but does not guarantee better lookup results or make websites load faster.
| Setting | Input or source | When to use it | Key limitation |
|---|---|---|---|
| System DNS | The current network’s system resolver | Establishing a working baseline and accessing local network names | Results depend on the current network and system configuration |
| Custom standard DNS | The resolver’s IP address | Comparing results and reachability with the network’s default resolver | DNS queries are typically sent unencrypted |
| DNS over HTTPS | The complete HTTPS endpoint URL | When you need encryption between the client and resolver | Requires endpoint resolution, an HTTPS connection, and certificate validation |
A port number alone does not identify a service. Port 443 on an arbitrary website does not provide DoH; the resolver must support the service and URL path. DoH encrypts queries in transit to the resolver, which still processes them. Enabling DoH does not automatically route subsequent website connections through a proxy.
Takeaway: Keep a Verifiable Baseline
If system DNS opens the websites you normally use, record that as your baseline. Then test custom DNS or DoH separately. Don’t change your route, rules, and resolver at the same time, or you won’t know which change caused the result.
Settings and Config Files: Check What’s Active First
Check the connection status on Home, then confirm which Config file is selected in Config. Settings → DNS shows the app-level DNS settings. The selected file in Config may also define dns-server under [General]. Menu labels and editing steps may vary by app version; always check the currently active file, not an arbitrary file in the list.
- In Config, confirm which file is selected, open its editing view, and save a copy of the original text before making changes.
- Look for
dns-serverunder[General]. Note whether it is present and whether its value issystem, an IP address, or an HTTPS endpoint. - Then check Settings → DNS and compare it with the file to make sure the two locations don’t contain conflicting values.
- After saving changes, reconnect and make a new request. Don’t judge whether the setting took effect by refreshing a page on an existing long-lived connection.
If the active Config file explicitly defines dns-server, check the DNS behavior against that setting first rather than assuming the default in Settings is the effective value. If the file does not define it, check DNS in Settings. Per-domain DNS settings, Hosts, or cached results may also bypass the general upstream resolver, so it is not safe to assume every domain uses the same DNS address.
Active Config file
- Where to check
- Config → currently selected file
- Config section
[General]- Key to check
dns-server- System value
system
If the file explicitly sets DNS, check that value first; recheck after switching files.
App default settings
- Where to check
- Settings → DNS
- What to check
- Resolver and any related enabled options
- How to verify
- Reconnect after saving
- What to test
- New domain requests
The value shown in the app doesn’t prove it’s active. Confirm it against the current file and request results.
Config in Global Routing means routing according to the Config’s rules; it is not a master switch for whether a Config file is loaded. Proxy, Direct, Config, and Scene control their respective routing behavior. Switching between them does not replace checking dns-server. Updating a server subscription should not be treated as a way to reset DNS. If you update a Config file, check whether the update changed this field.
Config Syntax: How to Set System DNS and a DoH Endpoint
The two snippets below illustrate the syntax; choose one, and don’t add the same key twice in one section. If the file already has a [General] section, edit the relevant line instead of creating another section with the same name. The first example explicitly uses the system resolver:
[General]
dns-server = system
The second example shows the format for a DoH endpoint. dns.example.com is an illustrative domain, not a working service; don’t copy it into your settings. Use the complete endpoint URL you’ve verified is reachable, supports DoH, and has a valid certificate.
[General]
dns-server = https://dns.example.com/dns-query
- Standard DNS: Enter the resolver’s IP address. Don’t enter a standard DNS address as an HTTPS endpoint.
- DoH: Keep
https://, the hostname, and the complete path required by the service./dns-queryis common, but not all services use it. - Endpoint hostname: Its IP address usually needs to be resolved before an HTTPS connection can be established, so the initial resolution path must also work.
- Certificate: Don’t disable certificate validation to troubleshoot a connection failure. First check the device’s time, the endpoint hostname, and network connectivity.
If the endpoint’s domain can only be resolved through the same DoH service that has not connected yet, this can create a startup dependency. If that happens, switch back to system DNS to verify basic connectivity, then check the endpoint’s initial resolution and connection path. Don’t replace the hostname in the URL with an IP address; that may break certificate name validation and server-side host identification.
DNS and Routing Rules: Resolution Doesn’t Choose the Route
DNS returns an address; routing rules determine how the connection is handled. They are related but serve different purposes. DOMAIN-SUFFIX matches a domain suffix; IP-CIDR matches an IP range; GEOIP checks the address’s geographic assignment; and FINAL is the fallback. Whether a request needs local resolution depends on the available destination information, the matching process, and the connection method.
[Rule]
DOMAIN-SUFFIX,example.com,DIRECT
IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
GEOIP,CN,DIRECT
FINAL,PROXY
This is an example of rule syntax, not a recommended configuration for everyone. PROXY requires a working proxy policy. In this example, no-resolve means not to trigger a DNS lookup just for this IP rule; it does not disable DNS across the app. Rules are evaluated in order, so an earlier match may already determine the route. Don’t check only the final FINAL rule.
For public domains, the resolver’s location can also affect the addresses returned by a content delivery network. A closer result does not mean your final route will reach it faster. Check whether resolution succeeds, which policy the rules match, and whether that policy can connect to the destination. Don’t compare DNS response times alone.
Testing Steps: Change One Setting at a Time
Run comparative tests on a stable network. Keep the selected server, Global Routing mode, and Config file fixed, then change DNS. If conditions under Settings → On Demand can automatically change the connection state during testing, record them too, so you don’t mistake an automatic reconnect for a DNS effect.
- Record a baseline: Note whether you’re on Wi-Fi or cellular, the active filename, routing mode, and original DNS value. Confirm whether you can open two commonly used public websites.
- Check special names: If you need to access local network services, also note whether their domain names resolve. Don’t test only public websites.
- Change one setting: Change only one of system DNS, custom standard DNS, or DoH. Don’t also change IPv6, rules, or the selected server.
- Reconnect: After saving, disconnect and reconnect, then make a new request. Browser and app caches may still affect what you observe.
- Record each stage: Note whether the domain resolves, whether you see a certificate warning, whether the connection times out, and whether all page resources load.
- Verify by reverting: If it fails, restore the original value and test again on the same network. If the original value works and the new one keeps failing, you have a basis for investigating the new resolution path.
Don’t treat an extremely fast response to repeated queries for the same domain as proof of resolver performance; a cache hit may mean no upstream query was sent at all. Also, don’t enter a long list of servers and assume the first one always takes priority. Confirm multi-upstream selection and fallback behavior from the settings and actual results.
Takeaway: Keep Records That Explain the Results
If system DNS works but DoH fails, check endpoint resolution, the connection on port 443, and the certificate. If both resolve successfully but webpages still time out, focus on the matching rule, selected route, and connection to the destination instead of switching DNS again.
Common Issues: DNS Changes Don’t Take Effect, or Sites Still Won’t Load
Why didn’t the results change after I changed DNS in Settings?
In Config, first check whether the active file explicitly sets dns-server under [General]. Then check for Hosts or domain-specific handling. Save your changes, reconnect, and make a new request. Unchanged page content does not mean the setting failed; both resolvers may return the same address.
Do I need to switch servers if webpages stop loading as soon as I enable DoH?
Restore the original DNS setting first and confirm the connection works. Then check the DoH URL’s scheme, hostname, and complete path. Next, verify that the endpoint can be resolved initially and reached over HTTPS. Opening a regular webpage only proves that the site is reachable; it does not prove the specified URL provides a valid DoH response.
The domain resolves to an IP, but the webpage keeps loading. What should I do?
Leave DNS unchanged. Go to Home and check Global Routing and the current selection, then check which rule in Config matched. If the lookup returned both A and AAAA records, also check the IPv4 and IPv6 connection paths on your current network. Having an address does not mean both paths can reach the destination.
Wi-Fi works, but cellular doesn’t. What should I check first?
First confirm that the connection is still in the expected state, then check the conditions under Settings → On Demand. System DNS and endpoint reachability can both change with the network, so test again on cellular rather than relying on results from Wi-Fi.
Does enabling DoH send all DNS queries through a proxy?
Enabling DoH alone does not determine the route. DoH describes how DNS queries are sent over HTTPS; the actual outbound path also depends on related settings, rules, and the current routing state. Check the endpoint’s actual connection path against your network requirements. A URL starting with HTTPS is not enough to tell you.