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

Learn how Shadowrocket’s DNS settings work: when to use system DNS, how to enter a custom DNS server, when DNS over HTTPS makes sense, and how to troubleshoot resolution failures.

At a Glance

If everything works normally, keep system DNS. Enter a custom DNS server only if you already have a specific resolver address, and use DNS over HTTPS when you need to encrypt queries between the client and resolver. This guide is for Shadowrocket users who are already connected and want to troubleshoot DNS separately. Follow the steps in order to distinguish a resolution failure from a routing-rule mismatch or a connection failure.

First, Identify Whether the Failure Is in DNS or the Connection

DNS queries resolve domain names to addresses; they do not determine whether a webpage uses DIRECT or a proxy. For requests that resolve locally before connecting, use this flow to narrow down the issue. It is not a fixed sequence for every request.

Domain requestResolver queryAddress returnedConnection to destination

With Config selected under Global Routing, DOMAIN-SUFFIX can match a domain without waiting for the destination IP, while IP-CIDR requires an address to match. Some proxy connections can also send the domain to a remote resolver, so the DNS setting in the app may not handle every request. To test DNS, keep the network, configuration, and Global Routing setting unchanged. Don’t change rules or switch routes at the same time.

  • Query timed out: No response arrived within the allowed time. Check the resolver address and network connectivity first. If you’re using DoH, also check whether the HTTPS endpoint can be reached.
  • NXDOMAIN returned: A DNS response arrived, but the resolver says the name does not exist. Check the spelling and full domain name. For an internal domain, confirm that the current resolver can resolve it.
  • An address was returned, but the webpage still times out: Check whether the failing request uses the same domain, then review the rule that matched, the selected route, and the destination port. A DNS response does not mean the destination is reachable; other domains the webpage depends on may also fail independently.

System DNS: The Everyday Default and a Baseline for Internal Networks

If you haven’t specified a resolver, start with system DNS. It follows the network settings currently active on the device; it does not point to one fixed server. The system may use different DNS settings on Wi-Fi and cellular networks. This is a useful baseline for home devices, workplace systems, and guest Wi-Fi with a sign-in page.

  1. Check the current DNS-related settings in Settings, then confirm which configuration is active in Config. If the current platform uses a configuration file to specify a resolver, check whether dns-server is set under [General]. Don’t edit an inactive copy.
  2. If the configuration explicitly specifies a resolver, save the original value first. To compare against system DNS using the configuration text, change the existing dns-server entry to system, save, and reconnect. Don’t add a second setting with the same name in the same section.
  3. On the same network, test one public domain that usually works and one full internal domain that you know exists. If you’re on guest Wi-Fi with a sign-in page, complete the sign-in first, following the network’s instructions, then test the external resolver. A timeout before sign-in does not by itself point to a DNS configuration problem.

If internal sites fail only on workplace Wi-Fi, test again with system DNS, then ask your network administrator to confirm the internal domain and the required resolver. A public resolver may resolve public domains just fine without knowing your company’s internal DNS records. In that case, switching to public DoH won’t add the missing records.

Custom DNS and DoH: Enter an IP Address or a Full URL

Custom DNS changes which resolver answers queries; DoH also changes how those queries are transmitted. To edit the configuration text, change dns-server under [General] in the active configuration. The IP addresses and domain names below are format examples only, not values to use for an actual connection. Use values provided by your network administrator or chosen DNS service.

Standard DNS: Specify a Resolver Address

Configuration section
[General]
Example format
dns-server = 192.0.2.53
Common port
53, usually UDP; TCP is also supported
When to use it
You know the resolver’s IP address, and the current network allows access to it

Entering an IP address alone does not encrypt standard DNS queries.

DNS over HTTPS: Specify a Query Endpoint

Configuration section
[General]
Example format
dns-server = https://dns.example.com/dns-query
Default port
443, as configured for the HTTPS endpoint
When to use it
You need encrypted DNS queries, and the client can reach the HTTPS endpoint

Use the full query URL supplied by the provider. Don’t use the provider’s homepage as the query endpoint or change the path yourself.

Choosing a Resolver: Make Sure It’s Reachable on the Network You’re Using

If DoH works on cellular but keeps timing out on workplace Wi-Fi, temporarily switch back to system DNS on that Wi-Fi network as a comparison. If system DNS works, check whether the DoH endpoint is reachable on that network. Keep the working configuration rather than changing the resolver, rules, and route all at once.

DoH encrypts DNS queries between the client and the selected resolver; it does not encrypt all traffic to the destination website. The resolver can still see the queries it receives. If the DoH URL uses a hostname, the client must first resolve that hostname to an address. Even when the port is reachable, queries may fail because the path is wrong, the system clock is inaccurate, or certificate validation fails. Don’t bypass certificate checks to make a connection work, and don’t casually replace the hostname in the URL with an IP address.

DNS Resolution Failures: Test One Variable at a Time

53
Standard DNS port
443
Default port for DoH over HTTPS
  1. Record the conditions. Note the failing domain, current network, active configuration, and selected Global Routing option. Check the connection status in Home. If the connection comes back after you disconnect manually, check the triggers under Settings → On Demand first so you don’t mistake an automatic reconnect for a stable setting change.
  2. Change only the resolver. Save the original settings, then test with system DNS on the same network. Switch back to the custom IP or DoH and test again. The same domain may still return a cached result; reconnecting does not guarantee that all system or app caches are cleared. Cross-check with another known-accessible domain you haven’t tested yet, and, if needed, wait for the cache to expire before comparing the original domain again.
  3. Distinguish no response from an error response. For a standard DNS timeout, first check whether the resolver’s IP is reachable. For a DoH timeout, verify the full URL, resolution of the endpoint hostname, and HTTPS connectivity. If you receive NXDOMAIN, check the domain spelling and whether the resolver handles that internal domain instead of simply increasing the wait time.
  4. Once you get a response, check routing and connectivity. If diagnostics return an A or AAAA record, check which address and route the connection actually attempts to use. A destination with only an AAAA address needs a working IPv6 path; an address with a connection timeout is not necessarily a DNS problem. Check the matching rule and FINAL in the current configuration only when Config is selected under Global Routing.

FAQ: Why Didn’t the Result Change After Updating the Setting?

Why am I still getting the same IP after changing DNS?

First, confirm in Config that you edited the active configuration, then try a domain you haven’t tested yet. The original domain may still be served from cache, or both resolvers may return the same record. An unchanged IP alone doesn’t prove the setting failed to take effect.

If a DoH URL opens in a browser, does that mean it will work?

Not necessarily. A normal browser visit does not send a complete DoH query. The endpoint may return an error page while still supporting correctly formatted requests. Check the query URL published by the provider, then use Shadowrocket to make an actual DNS query for a domain and compare the result with system DNS.

Public domains work, but company internal domains don’t. What should I check?

On a workplace network you’re authorized to use, switch back to system DNS and retry with the full domain name provided by your administrator. If it resolves, keep the DNS settings required on that network. If it still fails, ask your administrator whether the record exists and whether you need to connect to the company network to reach the resolver.

If DNS returns a result but the connection fails, should I keep changing DNS?

Not yet. Confirm that the response is for the domain that actually fails, then check Global Routing and the connection result for the destination address. If the main webpage domain works but images or sign-in fail, check the domains used by those resources separately. A successful lookup for the main domain doesn’t mean the entire page is working.

Download Shadowrocket