What the message looks like
$ dig example.com
;; communications error to 192.0.2.53#53: timed out
;; communications error to 192.0.2.53#53: timed out
;; no servers could be reachedCommon causes
- The configured DNS server address is wrong or the server is down.
- A firewall drops UDP and TCP port 53, on the client, the server or in between.
- The DNS service (
named,unbound,dnsmasq) does not run or listens only on another interface. - No route to the server, for example a VPN or network change.
- Large answers need TCP, and only UDP is allowed.
Check
- Which server does the system use?
resolvectl status - Same query against a public resolver. Does the network work at all?
- Query over TCP instead of UDP
dig example.com @192.0.2.53 +tcp +time=3 +tries=1 - On the DNS server: does it listen on port 53?
sudo ss -lunpt | grep ':53 '
Fix
- If the query to a public resolver works, the configured server is the problem: replace it or repair it.
- If nothing works, fix the network first: route, gateway, VPN, cable.
- On your own DNS server, start the service (
sudo systemctl status unboundornamed) and check that it listens on the interface the clients use. - Allow port 53 for UDP and TCP in the firewall in both directions as needed. Allow it only from the networks that need it.
- If only TCP fails, answers may be big or cut. Allow TCP 53, do not block it.
FAQ
Is the domain broken?
Probably not. No answer means the resolver or the path is broken. A broken domain gives an answer such as NXDOMAIN or SERVFAIL.
It works with 8.8.8.8 and not with my router.
Then the router or the upstream behind it is the problem. Set another resolver on the client to confirm, then fix or replace the router DNS.