java.net.UnknownHostException, or "Can't resolve hostname" in the server list, means your computer could not turn the address into a number. No connection was ever attempted. Whether the server is up is not yet a question that has been asked.
Why this one is different ¶
Every other Minecraft connection error happens after DNS succeeded: your client had an address, tried it, and something went wrong. This one happens before that. The server could be perfectly healthy and you would still see it, which is why "the server is down" is the wrong first thought.
It is also the fastest to fix. Most causes are on your machine and take seconds.
1. A typo, or invisible characters ¶
Check the address character by character, and be suspicious of anything you pasted. Copying a server address from Discord or a website frequently brings a trailing space, a zero-width character, or a smart quote along with it, none of which are visible in the input field.
Retype it by hand once. If typing works and pasting does not, that was the answer.
2. The port is in the address field ¶
The server address goes in one field, and a port belongs after a colon: play.example.com:25565. A space instead of a colon, or a comma, makes the whole string an invalid hostname. So does including http://, which people add out of habit and which Minecraft has no idea what to do with.
3. Your DNS resolver is not answering ¶
If other things also fail to resolve, the resolver is the problem rather than the address. Test the name directly:
- Windows:
nslookup play.example.com 1.1.1.1 - macOS / Linux:
dig @1.1.1.1 play.example.com +short
An answer from a public resolver but not from your normal one means your router or ISP resolver is at fault. Point the device at a public resolver and retry. Our DNS lookup shows the authoritative record, so you can see what the correct answer is supposed to be.
4. A stale cache holding a dead answer ¶
Negative answers are cached too. If the domain was briefly misconfigured, your machine may hold "this does not exist" for minutes after it was fixed. Clearing the cache is the fix, and the commands are in our DNS flush guide.
Java maintains its own DNS cache on top of the operating system's, which is why restarting the Minecraft launcher sometimes fixes this when flushing the OS cache alone did not.
5. The domain expired or the record was removed ¶
Not everything is on your side. A server whose owner let the domain lapse, or removed the A record during a migration, produces exactly this. The distinguishing test is whether anyone else can resolve it: if a public resolver also returns nothing, the record is genuinely gone and no local fix exists.
This is also what a browser NXDOMAIN means, and the diagnosis is identical.
SRV records: resolving but still not connecting ¶
Many networks publish an SRV record so players can type play.example.com with no port. If the A record resolves but the SRV record is missing, the client falls back to port 25565 and you get a timeout rather than this error.
So resolving successfully and then timing out points at the SRV record or the port, not at DNS. That is a different article: Connection timed out.
Thirty-second sequence ¶
- Retype the address by hand, without the port.
- Query it against
1.1.1.1directly. - Flush the DNS cache and restart the launcher.
- If a public resolver also finds nothing, the address is dead — ask whoever runs the server.
An IPv6 answer your machine cannot use ¶
If a domain publishes only an AAAA record and your network's IPv6 path is broken, resolution technically succeeds and the connection then fails — but some resolver configurations surface it as an unknown host instead, which sends you looking in the wrong place.
Check what record types exist: dig play.example.com A +short
and dig play.example.com AAAA +short. An AAAA with no A, on a
network where IPv6 does not work, is the case. Java can be told to prefer
IPv4 with -Djava.net.preferIPv4Stack=true in the launcher's JVM
arguments, which is a workaround rather than a fix — the real fix belongs on
the network or with the server owner.
Java caches DNS separately, and aggressively ¶
The JVM keeps its own DNS cache in front of the operating system's, and by default a successful lookup can be held for the life of the process. That is why flushing the OS cache sometimes changes nothing until the launcher is restarted, and why a server that moved addresses can stay unreachable in one long-running client while working everywhere else.
Fully quitting the launcher, not just returning to the main menu, is the reliable way to clear it.
What to send the server owner ¶
If a public resolver also cannot resolve the address, the fault is theirs and a useful report is short:
- The exact address you typed.
- The output of
dig @1.1.1.1 <address>, which proves it is not your resolver. - Whether an IP address connects directly when the name does not — that narrows it to DNS immediately and rules out the server.
That last line is the one that saves the most time, because it separates a dead domain from a dead server in a single test.