Port 853 (DNS over TLS)

Port 853 is the port of DNS over TLS (DoT), a method that encrypts DNS queries between a computer and the DNS server, so that nobody along the way can…

Key facts

Port
853
Protocols
TCP, UDP
Range
System port (Well-Known), 0-1023
IANA service name
domain-s

IANA assigns ports in this range to well-known services, under RFC 6335.

About port 853

Port 853 is the port of DNS over TLS (DoT), a method that encrypts DNS queries between a computer and the DNS server, so that nobody along the way can read or change them.

DNS over TLS is defined in RFC 7858 and runs over TCP. IANA registers port 853 for the domain-s service: over TCP for DNS over TLS, and over UDP for DNS over QUIC (RFC 9250) and DNS over DTLS. Regular, unencrypted DNS queries travel over port 53.

What port 853 is used for

  • Public DNS servers: many DNS servers accept encrypted queries on port 853, alongside port 53.
  • Phones: the Private DNS option on Android devices sends queries over DNS over TLS.
  • Linux servers: the systemd-resolved service can send queries over DNS over TLS, using the DNSOverTLS setting.
  • Your own DNS server: a recursive DNS server in your organization can accept encrypted queries from computers on port 853.

Port 853 in the firewall

A computer or server that only sends queries needs to allow outgoing connections to port 853. A firewall that tracks connections lets the replies through automatically. On a DNS server that accepts encrypted queries, open the port to incoming traffic:

  • UFW: ufw allow 853/tcp
  • firewalld: firewall-cmd --permanent --add-port=853/tcp

When the DNS server is meant only for your own networks, allow the port only from them, just as with a recursive server on port 53:

  • UFW: ufw allow from 198.51.100.0/24 to any port 853 proto tcp
  • firewalld: firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="198.51.100.0/24" port port="853" protocol="tcp" accept'

Risks and security

DNS over TLS improves the privacy and reliability of DNS queries, and a few settings make sure the encryption works as it should:

  • Set the client to verify the server's certificate. In Opportunistic mode (encryption when possible, without certificate verification), someone along the way can impersonate the DNS server without any warning.
  • Specify the server name that appears in the certificate, for example dns.example.com, not just its IP address.
  • On your own DNS server, renew the TLS certificate before it expires, or clients won't be able to connect.
  • When a network blocks port 853, a client in Opportunistic mode falls back to unencrypted queries on port 53, and a client in Strict mode (encryption only) gets no answers. Check in advance which mode the client is set to.

Commands to check and configure

  • dig +tls @dns.example.com example.com A

    Sends a DNS over TLS query to the specified server. With the +tls option, the port is 853 by default.

  • dig +tls +tls-ca +tls-hostname=dns.example.com @192.0.2.53 example.com A

    Sends an encrypted query and checks that the server's certificate is valid and matches the name dns.example.com.

  • openssl s_client -connect dns.example.com:853 -servername dns.example.com

    Connects to port 853 and shows the TLS certificate the server presents, including the name and the expiry date.

  • resolvectl status

    Shows the DNS servers the computer uses, and whether DNSOverTLS is active on each network interface.

  • nc -zv dns.example.com 853

    Checks whether port 853 is open and reachable on the DNS server.

  • ufw allow 853/tcp

    Opens port 853 to incoming traffic on a DNS server that accepts encrypted queries (UFW).

  • firewall-cmd --permanent --add-port=853/tcp

    Opens port 853 in firewalld. Then run firewall-cmd --reload.

Port 853 in the IANA registry

Port Protocol Service IANA registry description
853 TCP domain-s DNS query-response protocol run over TLS
853 UDP domain-s DNS query-response protocol run over DTLS or QUIC

Data source: IANA Service Name and Transport Protocol Port Number Registry (opens in a new tab)

Port 853 FAQ

What's the difference between DNS over TLS and DNS over HTTPS?

Both methods encrypt DNS queries. DNS over TLS runs on a separate port, 853, so it is easy to identify and manage in the firewall. DNS over HTTPS travels over port 443, together with regular website traffic. In dig, you test the second method with the +https option.

How do I check whether a DNS server supports DNS over TLS?

Run dig +tls @dns.example.com example.com A. If you get an answer, the server accepts encrypted queries on port 853. The dig commands page has more options for testing DNS.

How do I turn on DNS over TLS on a Linux server?

On a server that uses systemd-resolved, add the lines DNS=192.0.2.53#dns.example.com and DNSOverTLS=yes to the /etc/systemd/resolved.conf file, and restart the service with systemctl restart systemd-resolved. The name after the # sign is used to verify the server's certificate.

Can I use DNS over TLS on my phone?

Yes. On Android devices, enter the server name, for example dns.example.com, in the Private DNS setting, and from then on the device sends its DNS queries encrypted on port 853.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement