Docs Config DNS Types

DNS Types

Each line under nameserver / fallback is a URL, and the protocol prefix determines how Clash talks to that DNS server. Here are all the supported formats.

Supported Types

TypeExampleDescription
UDP223.5.5.5 or udp://223.5.5.5The most common plaintext DNS; this is the default when no protocol prefix is given
TCPtcp://8.8.8.8The TCP version of plaintext DNS, slightly more resistant to interference than UDP
DNS over TLStls://1.1.1.1DoT — queries over an encrypted channel after a handshake, on port 853
DNS over HTTPShttps://doh.pub/dns-queryDoH — disguised as regular HTTPS traffic, offers the best network penetration, and is the recommended choice
DNS over QUICquic://dns.adguard.com:784DoQ — based on the QUIC protocol, balancing speed and resistance to interference
System DNSsystem:// or systemUses whatever DNS is currently configured at the OS level
DHCPdhcp://en0Uses the DNS obtained via DHCP on a specified network interface; dhcp://system is limited to the cmfa client and uses the system DNS
Fixed Responsercode://name_errorDoesn't actually query anything — just returns a fixed error code, commonly used to block domains
Available rcode Values
Example YAML
rcode://success            # No error
rcode://format_error       # Format error
rcode://server_failure     # Server failure
rcode://name_error         # Domain does not exist
rcode://not_implemented    # Not implemented
rcode://refused            # Query refused