How to Fix the 'Unknown Host' Error in Minecraft
You type in a server address, hit Join, and Minecraft says "Unknown host", or the log shows java.net.UnknownHostException. Unlike most connection errors, this one is very specific: your computer could not turn the server name into an IP address. The server might be running perfectly. Your game just cannot find it.
ipconfig /flushdns on Windows) and restart Minecraft. If it still fails, try a public DNS like 1.1.1.1. Server owners should check that the domain has the right DNS record.What the error actually means
Server addresses like play.example.com are names. Before connecting, your computer asks a DNS server, which works like a phone book, for the IP address behind that name. "Unknown host" means that lookup came back empty.
So the problem is never the server's lag, version or mods. It is always one of:
- The name is typed wrong.
- The name does not exist yet, or no longer exists.
- Your computer or network has a stale or broken DNS answer.
Fixes for players
1. Check the address carefully
This is the cause most of the time.
- Look for swapped letters, missing dots, and
lvs1orovs0. - Remove spaces at the start or end.
- Do not include
http://orhttps://. - If there is a port, it goes after a colon:
play.example.com:25566.
Copy and paste the address from the server owner if you can instead of retyping it.
2. Wait a few minutes if the address is new
When a domain or subdomain is first created, it can take a few minutes, occasionally longer, before every DNS server knows about it. If your friend just set it up, give it 5 to 10 minutes and try again.
3. Flush your DNS cache
Your computer remembers lookups for a while. If it cached a "not found" answer, it keeps failing even after the address starts working.
Windows: open Command Prompt and run:
ipconfig /flushdns
macOS: open Terminal and run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Then fully close and reopen Minecraft. Java also keeps its own cache while the game is open.
4. Try a different DNS server
Some internet providers' DNS servers are slow to update or have problems. Switching your computer or router to a public DNS service often fixes it right away. Common choices are 1.1.1.1 and 8.8.8.8. You can change this in your network adapter settings or your router settings.
5. Test the address outside Minecraft
Open Command Prompt or Terminal and run:
nslookup play.example.com
- It returns an IP: DNS works. Restart Minecraft and try again, or connect using that IP directly as a test.
- It says "can't find" or "NXDOMAIN": the name does not exist for your DNS. Tell the server owner, or try the public DNS fix above.
Fixes for server owners
If several players get "Unknown host", the problem is probably the domain setup.
- Check the record exists. A subdomain needs an
Arecord pointing to the server IP, or aCNAMEto another name that has one. - Check SRV records if you use one. An SRV record lets players skip the port. It has to be named
_minecraft._tcp.play(forplay.example.com) and point at a host name that resolves. Test it withnslookup -type=SRV _minecraft._tcp.play.example.com. - Check the domain has not expired. An expired domain stops resolving for everyone.
- Turn off web proxying for game records. If your DNS provider has a proxy option for web traffic, game records must not use it. Minecraft traffic is not web traffic.
Our custom domain guide walks through setting up A and SRV records step by step.
On FreaksMC, every server comes with a free subdomain that is set up for you, so there is no DNS to configure. If you add your own domain, support can check the records with you.
Related errors
- "Can't connect to server" or offline in the list: see server not showing up or says offline.
- "Connection timed out": the name was found but the server did not answer. See why can't my friends join.
- "Connection reset": you connected and then got dropped. See connection reset fix.
Quick checklist
- Address typed exactly right, no spaces or
http://. - New address? Wait 5 to 10 minutes.
- DNS cache flushed and Minecraft fully restarted.
- Public DNS tried.
nslookupshows whether the name exists.- Server owner: A or SRV record correct and the domain not expired.
Want a server that just runs fast?
FreaksMC runs on NVMe hardware with performance-tuned defaults baked in - pre-optimized Paper, sane view distances, and one-click world pre-generation. Set up in 60 seconds.
See plans from $3/mo