If you haven't specified a resolver, start with system as a baseline. If you have the address of a specific DNS server, enter its IP address. To send queries over HTTPS, enter the full DoH URL for a known resolver endpoint. Using the iPhone / iPad interface as an example, this guide explains how to set each value in the active configuration and how to tell a DNS lookup failure from a connection failure.
System DNS, custom DNS, and DoH compared
dns-server specifies how Shadowrocket resolves DNS queries when using that configuration. It answers the question “where should this domain be looked up?” Global Routing and rules, by contrast, determine “which route should this connection take?” For example, when Global Routing is set to Config, rules can match domains with DOMAIN-SUFFIX. Changing the DNS setting does not change DIRECT to PROXY in your configuration.
This flow assumes Shadowrocket handles the query and it isn't served from cache. It may not help you verify whether a change to dns-server took effect if an app reuses an existing connection, connects directly to an IP address, or uses its own resolver. Even if you receive a DNS response, routing, the destination port, or a TLS issue can still prevent the site from loading.
| Method | What to enter | Lookup path | When to use it |
|---|---|---|---|
| System DNS | system | Uses the device's current system DNS settings. | Use it as a baseline or keep the DNS resolver provided by the current network. |
| Custom DNS | IP address only, such as 192.0.2.53 | Sends a traditional DNS query to the specified server, using port 53 by default. | Your network administrator has provided a reachable resolver address. |
| DNS over HTTPS | Full HTTPS URL, such as https://example.com/dns-query | Sends an HTTPS request to a DoH endpoint, using port 443 unless another port is specified. | You have confirmed that the resolver supports DoH and have its complete endpoint URL. |
Bottom line: Test system DNS first for internal domains
On Wi-Fi that can access your internal network, use system to test a known internal domain before trying another resolver. If the alternative resolver can resolve public domains but reports that the internal domain doesn't exist, check whether it supports your internal DNS records before changing proxy rules.
Setting dns-server in Config
In Config, confirm which configuration is active, then tap the ⓘ beside that file. To inspect the original text, open the file menu and select Edit Plain Text. Find dns-server under [General]. Note the entire original line first. To try another method, replace that line; don't add a second entry with the same key to the same configuration, and don't put this field under [Rule].
System DNS and IP addresses
- Configuration section
[General]- System value
dns-server = system- Custom format
dns-server = 192.0.2.53- Address source
- The resolver IP address provided by your network administrator.
Use one format or the other. The example IP is reserved for documentation and is not a working DNS server.
DNS over HTTPS
- Configuration section
[General]- Endpoint format
dns-server = https://example.com/dns-query- Where to get it
- The full HTTPS URL provided by the DNS resolver.
- Connection requirements
- The endpoint is reachable, and its TLS certificate matches the hostname in the URL.
The example URL shows the format only. Use the path provided by your resolver; don't prepend https:// to a regular DNS address.
When switching from system DNS to an IP address, don't assume the gateway address shown in your Wi-Fi settings is a general-purpose resolver. A private IP may be reachable only on that Wi-Fi network and time out on cellular. For DoH, keep the hostname and path provided by the service. Replacing the hostname with its current IP may cause TLS certificate validation to fail. A hostname-based endpoint also needs to be resolved to an IP address before the HTTPS connection can be established.
After saving: change DNS only, then test
Keep the device, network, and outbound route the same for comparison. During testing, leave Global Routing set to Config on Home. Don't change rules, servers, or your system Wi-Fi DNS at the same time. Otherwise, even if access is restored, you won't know which change made the difference.
- Record a baseline first. Before making changes, use the current configuration to open a known-working public domain. If you normally access internal domains, record a known-working one as well. Make sure the page sends a fresh request rather than displaying previously loaded content.
- Save and reconnect. After replacing
dns-server, save the configuration. Return to Config and confirm you edited the active file, then disconnect and reconnect from Home. Reconnecting doesn't clear every app or system cache. If possible, verify with a test hostname you control that you know exists but haven't looked up yet. - Check DNS resolution and access separately. If diagnostics show a DNS query timeout, first check whether the resolver address or DoH endpoint is reachable. If the response is
NXDOMAIN, check the spelling and whether that resolver has a record for the domain. If you get the expected address but the page still fails, check the matching rule, outbound connection, and destination site's TLS instead of repeatedly changing DNS. - Test on another network or restore the original value. After confirming it works on Wi-Fi, repeat the same checks on cellular if needed. If only the new value fails, restore the original line you noted, save, and reconnect. Once the original value works again, check the new resolver's address, port, or path one item at a time.
Connectivity Test on Home can offer clues about connectivity, but a successful test alone doesn't prove that a public or internal domain was looked up using the new DNS setting.
Common DNS setup questions
It works at home but times out on cellular. What should I change?
In Config, first check whether dns-server contains a private IP address on your home network. If it does, restore system, reconnect, and try the same public domain. If that works, the cellular network probably can't reach the original resolver. That doesn't mean a home-only domain will be available over cellular.
If a DoH URL returns 400 in a browser, does that mean it's wrong?
Not necessarily. A regular browser request to a URL usually doesn't include the data required for a DoH query, so the endpoint may return 400. Check the hostname and path character by character, then verify by accessing an actual domain through Shadowrocket. If the browser reports a certificate error instead of an HTTP status code, check the system time and endpoint hostname first.
If I switch to DoH, will all website traffic go through the proxy?
That setting doesn't determine how website traffic is routed. DoH specifies that queries to the resolver endpoint are sent over HTTPS; it doesn't decide how subsequent website connections are routed. Check Global Routing on Home. If you're using Config, also check the rule matching the destination domain and its associated policy.
I changed DNS yesterday. Why am I seeing the old value today?
First, check the active filename in Config, then use Edit Plain Text to inspect the value under [General]. If you switched files or re-imported a configuration that overwrote the original, the active file is the one that matters. Keep a copy of the original value before changing anything, and avoid editing multiple configurations at once.