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

Compare system DNS, custom DNS, and DNS over HTTPS. Learn how to edit dns-server in your config and verify DNS queries.

At a glance

If DNS works on your current network, keep system DNS. To use a specific reachable resolver, set a custom DNS server. Choose DNS over HTTPS when you need encryption between your device and the resolver. The steps use Config and Home on iPhone / iPad; the same configuration and testing approach applies to other platforms. After making a change, confirm that queries succeed, then check whether they actually reached the specified resolver.

System DNS, custom DNS, and DoH compared

This section compares who handles DNS lookups in Shadowrocket and which protocol carries them. System DNS uses the device’s current system resolution path rather than a fixed server address. Both custom DNS and DNS over HTTPS (DoH) let you specify a resolver; here, custom DNS means a traditional IP address, while DoH uses an HTTPS URL.

SettingResolution pathWhen to use itCheck first
System DNSUses the system’s current DNS settingsKeep the current network’s DNS behavior, such as resolving office intranet hostnamesWhether results change when switching to cellular or another Wi-Fi network
Custom DNSSends traditional DNS queries to a specified IP address, usually over UDP 53 and, when needed, TCP 53Compare performance across networks using the same reachable resolverWhether the current network can reach port 53 at the target IP
DNS over HTTPSSends DNS queries to a specified HTTPS endpoint, using port 443 unless another port is configuredEncrypt DNS queries between the client and resolverWhether the endpoint hostname resolves, its TLS certificate is valid, and the URL path is correct

Check whether switching works with an intranet hostname first

If public websites load but a required intranet hostname stops resolving after the change, switch back to system DNS and compare on the same network. Don’t change Global Routing or rotate resolver addresses yet.

How DNS queries interact with Global Routing

The flow below describes local DNS lookups initiated by Shadowrocket. Some requests can be routed by domain rules and resolved by the proxy; an app may also resolve names itself. Changing dns-server does not force every app or outbound connection to use the same resolver.

Hostname lookupChoose a resolverSend the queryReceive the response

Edit dns-server under [General] in Config

For testing, specify one primary resolver at a time. The IP addresses below are documentation examples, and the HTTPS URL is also illustrative—not a working service. Use a resolver address you already have permission to access, or the full DoH URL provided by your administrator.

  1. In Config, check which config is selected. Keep the original and make changes to a test copy. If the original config has fallback-dns-server, note its value too. If fallback resolution succeeds, a website loading on its own does not confirm that the primary resolver is being used.
  2. Open the test config in the text editor and find [General]. If dns-server is already present, replace that line instead of adding a second key with the same name. Leave other settings unchanged for now.
  3. Save and select the test config in Config. Go to Home, confirm Global Routing is set to Config, then disconnect and reconnect. When comparing system DNS with another setting, keep the routing mode and network the same for both tests.

System DNS baseline

[General]
dns-server = system

How to enter the two explicit resolver types

Traditional DNS address

Section
[General]
Example line
dns-server = 192.0.2.53
Common ports
53

If you use a local network resolver, check that it is still reachable when you leave that network.

DNS over HTTPS endpoint

Section
[General]
Example line
dns-server = https://dns.example.com/dns-query
Default port
443

/dns-query is an example path. Use the full path provided by your resolver.

Don’t replace the hostname in a DoH URL with an IP address just to avoid the initial hostname lookup. Unless the resolver explicitly supports IP-based access, this may cause TLS certificate name verification to fail. Opening the endpoint’s homepage in a browser is not a substitute for a valid DoH query.

Verify DNS changes: check the response and query source separately

  1. Establish a baseline first. On the same Wi-Fi or cellular network, test once with system DNS and record the time, full hostname, and result. If you rely on intranet services, also test a known resolvable intranet hostname. Establish a new baseline after switching networks; don’t assume any difference is caused by the DNS setting.
  2. Minimize cache and app-managed DNS effects. After changing the setting, retest with an app known to use the DNS path you’re testing. If the app has its own encrypted DNS enabled, check whether it bypasses this setting. If possible, use a new, previously unqueried test hostname in a domain you manage, with a valid DNS record configured for it. Reopening the same page may reuse a cached result or existing connection.
  3. Check the query source if logs are available. In the query logs for a resolver you manage, search by time, full hostname, and record type—for example, A for IPv4 or AAAA for IPv6. If the app’s logs show the resolver address or transport, check those too. Without evidence of the query source, you can confirm only the lookup or access result; a page loading does not prove that the specified DoH resolver was used.
  4. Troubleshoot by error type. NXDOMAIN means the resolver reports that the hostname does not exist. Check the spelling and compare internal and external DNS results. A timeout means no response arrived in time; first check whether the resolver is reachable. For a confirmed TLS error, check the endpoint hostname, certificate, and device date and time.

Connectivity Test in Home can help check connectivity, but its result alone cannot show which resolver answered for a hostname or prove that a DNS query used DoH.

Common issues after changing DNS

I changed dns-server, but websites still load. How can I tell if the setting took effect?

In Config, confirm that the saved test copy is selected, then reconnect from Home. Retest with a valid hostname that hasn’t been queried before and check the specified resolver’s logs. If only the fallback resolver received the query, investigate the primary resolver first.

It works on home Wi-Fi but times out on cellular. What should I do?

On cellular, restore dns-server = system, reconnect, and test the same hostname. If system DNS works but the custom address is reachable only at home, don’t keep using it as a fixed resolver across networks.

Public websites load after switching to DoH, but office intranet hostnames don’t. What should I do?

Stay on the office network and use the original config to test the same full intranet hostname. If it resolves again, check whether the DoH endpoint can resolve that internal zone. If it cannot, use a configuration that can resolve the internal zone while working at the office.

Why did the connection come back before I finished editing the config?

On iPhone / iPad, check the automatic connection conditions under Settings → On Demand. If the current network meets those conditions, you can pause automatic connection while you make and compare the changes, then restore the original settings. On Demand controls when a connection starts; it does not choose the resolver.

Download Shadowrocket