Shadowrocket DNS Settings: System DNS, Custom DNS, and DNS over HTTPS

Compare system DNS, custom DNS, and DNS over HTTPS, with dns-server examples and steps to verify or revert changes.

At a glance

System DNS provides a baseline for troubleshooting your current network. Custom DNS lets you specify a resolver, while DNS over HTTPS encrypts queries between the client and resolver. This guide is for Shadowrocket users with their own service provider and subscription. It explains how to edit the General section in Config, distinguish DNS issues from connection failures, verify a DNS change, and roll it back.

1. Distinguish DNS resolution from website connectivity

DNS resolves domain names to addresses. For example, an A record lookup returns an IPv4 address, while an AAAA lookup returns an IPv6 address. Reaching an HTTPS website also requires establishing a connection, completing a TLS handshake, and retrieving content. So a DNS response does not guarantee that a webpage will load, and a page that will not load does not necessarily indicate a DNS problem.

Request a domain Query a resolver Get an address Establish a connection Retrieve content

This flow helps isolate problems; it does not mean every request is resolved locally. In Shadowrocket, where resolution takes place also depends on the request type, rules, and proxy egress. Some connections can pass the destination domain to a remote endpoint. Setting a DNS address locally does not prove that every domain is handled by that resolver.

When troubleshooting, check the current server on Home, then review Global Routing. Config applies routing rules from the active configuration; Proxy and Direct change the global routing mode, while Scene follows the selected scene's settings. Keep the routing mode unchanged while comparing DNS options. Changing both the egress and resolver at once makes it difficult to tell which change caused the result.

2. System DNS, custom DNS, and DoH compared

Here, “custom DNS” means traditional DNS with a resolver IP entered directly, as distinct from an HTTPS endpoint. From a configuration perspective, a DoH endpoint you enter yourself is also a custom setting. Choose based on your network, resolver reachability, and query transport requirements—not on which option sounds more advanced.

MethodResolution pathWhen to use itWhat to check
System DNSUses the resolver currently available to the system, which is typically affected by the current Wi-Fi or cellular network.Establishing a troubleshooting baseline or resolving internal domain names provided by the current network.The resolver and results may change when you switch networks.
Custom DNSSends traditional DNS queries to a specified resolver IP.You need a fixed resolver, and its address is reachable on the current network.UDP/TCP port 53 reachability, and whether the resolver accepts queries from your current source.
DNS over HTTPSSends DNS queries to a DoH endpoint over HTTPS.You need encrypted query transport, and the HTTPS endpoint and certificate are available.The full endpoint path, TLS certificate, initial resolution of the endpoint domain, and actual routing.
53
Traditional DNS typically uses UDP/TCP port 53
443
HTTPS uses port 443 by default when no port is specified
2 types
Address records: A for IPv4, AAAA for IPv6

DoH encrypts the connection between the client and resolver. The resolver can still process and see the queries it receives, and website connections still follow their own egress paths. Enabling DoH does not automatically route all traffic through Proxy, nor does it replace checking rules and server status.

Bottom line: verify reachability before choosing DoH

If system DNS resolves reliably but DoH queries time out, check the endpoint and TLS path first. Don't change Global Routing at the same time. For internal domain names, keep the system DNS test results and check whether an external resolver has the same records before switching.

3. Set dns-server in Config

dns-server belongs in the [General] section of the configuration file, not in [Rule]. Each code block below is a separate option; do not combine all three into one file. When editing an existing configuration, keep its rules and other fields intact, and change only the DNS setting you are testing.

  1. In Config, confirm which configuration file is active. Save a local copy first, and note the current dns-server value.
  2. Open the file's edit option and locate [General]. If dns-server is already present, edit that line to avoid duplicate keys.
  3. Choose one option at a time. After saving, confirm that this file is still active; editing an inactive copy will not change the current connection.
  4. Return to Home, disconnect, and reconnect to test the saved configuration with a new connection. Existing connections and cached data may affect what you see.

Option A: Use system DNS

[General]
dns-server = system

Option B: Specify a traditional DNS address

[General]
dns-server = 192.0.2.53

Option C: Specify a DoH endpoint

[General]
dns-server = https://dns.example.com/dns-query

4. Check DNS settings separately from rules and Host

DNS resolves addresses, rules select a request policy, and Host can provide fixed mappings for specific domains. They affect different stages. If the configuration already has a Host mapping, a domain might not be queried upstream as expected. If the app retains an old address, refreshing the page immediately may not reveal a change.

Check DNS settings

Location
Config → active file → Edit
Section
[General]
Field
dns-server
Check mappings
Is the target domain listed in [Host]?

Confirm which file is being tested, then check whether a fixed mapping is affecting the result.

Check routing mode

Location
Home → Global Routing
Config
Applies routing rules from the active configuration
Proxy / Direct
Use to distinguish the global egress mode
Scene
Check the settings for the selected scene

Keep the routing mode unchanged during DNS tests. Don't change the resolver and egress in the same test.

For example, DOMAIN-SUFFIX matches domain suffixes, IP-CIDR matches address ranges, GEOIP matches against an IP geolocation database, and FINAL handles requests that did not match earlier rules. When using IP-based rules, check the resolution results and rule options to confirm what matched. A domain rule match alone does not prove that DNS succeeded.

5. Verify and document your changes

For a valid comparison, keep the network, target, and routing mode the same, and change only one field. Choose a domain you are authorized to access and that is actively maintained. Record how it behaves with system DNS first, then test traditional DNS or DoH. Don't judge resolvers by how quickly a page loads once: connection reuse, page caching, and website response times can all obscure DNS differences.

  1. Establish a baseline: Record whether you are on Wi-Fi or cellular, the current server on Home, the Global Routing mode, the active Config file, and the target domain.
  2. Save and reconnect: Change only dns-server, save the configuration, and reconnect. End old requests in the target app, then make a new request to the domain.
  3. Check resolution: Use an available DNS lookup tool or app log to inspect the result for the target domain. Record A and AAAA results, timeouts, or error responses. If the tool lets you select a resolver independently, confirm it is using the one being tested.
  4. Check the connection: See whether the actual request succeeds, which policy it matches, and whether any connection or TLS errors occur. Don't record only a latency number.
  5. Test network changes: After comparing options on the same network, test Wi-Fi and cellular separately. If only one network fails, first investigate differences in reachability on that network.
Observed resultWhat to check nextConclusion to avoid
Traditional DNS times out; DoH returns a resultCheck the UDP/TCP port 53 path between the current network and the resolver.This does not establish that all website connections are working.
DoH reports a TLS errorCheck the endpoint domain, certificate validity, system time, and connection path.A certificate error is not simply a slow DNS response.
A returns a result; AAAA does notCheck whether the domain has an AAAA record, and distinguish a missing record from a query timeout.No AAAA record does not mean DNS is failing overall.
An address is returned, but the webpage still times outCheck the matched rule, current egress, and reachability of the returned address.Changing resolvers is not guaranteed to fix the problem.
Results are exactly the same after the changeCheck the active file, Host mappings, cache, and existing connections.The same results do not, by themselves, prove the change did not take effect.

Bottom line: use both query results and connection results

The setting meets your current needs only when the DNS response is normal and the actual connection succeeds. If it fails on just one network, keep a record of the error, revert to a configuration you have verified, and investigate the failing step separately.

6. Frequently asked questions and safe rollback

If I enter multiple resolvers, will Shadowrocket automatically fall back in order?

Don't infer query order, parallel behavior, or fallback behavior from the order in which entries are written. For initial troubleshooting, use just one resolver you have confirmed is reachable. After verifying it works, adjust the setup to meet your needs. Mixing system DNS, traditional DNS, and DoH in one list makes it harder to identify which resolver returned a given response.

Does enabling DoH guarantee that queries go through Proxy?

Not necessarily. DoH describes the query transport, not the routing policy. Check the actual path against the active configuration, Global Routing, and DNS-related settings. The presence of https:// alone does not prove that queries use a particular egress or that every app follows this resolution path.

What should I check if the problem returns after switching Wi-Fi networks?

First, check whether system DNS changes with the network and whether the custom endpoint is reachable on the new network. If Settings → On Demand is configured, also review its connection conditions and confirm that an automatic rule did not change the connection state during testing. On Demand controls when a connection starts; it does not replace dns-server.

How do I restore the previous settings?

In Config, restore the original dns-server line or re-enable the local copy you saved earlier, then return to Home and reconnect. If the original file did not include this field, remove it to restore the original state rather than adding a guessed value. Retest with the same target to confirm the rollback, and change just one setting at a time afterward.

The goal of DNS settings is to get verifiable results that suit your needs, not to find one method that works on every network. Check system DNS, traditional custom DNS, and DoH on the network you actually use. Keeping a copy of your configuration and a record of tests is more useful for troubleshooting than frequently switching several settings.

Verify the App Store listingDownload Shadowrocket