Photo by Addy Spartacus on Unsplash
So there I was, trying to hop on my friend's Minecraft server on a Friday night, and I kept getting slammed with this connection error. Server address looked fine, the server was definitely up — my buddy was already in-game — but Minecraft just refused to connect. Classic DNS cache poisoning situation, and honestly it took me longer than I'd like to admit to figure that out the first time it happened to me.
If you're seeing something like this in your Minecraft client:
io.netty.channel.AbstractChannel$AnnotatedConnectException:
Connection refused: no further information: <server-ip>:25565
-- or --
java.net.UnknownHostException: <server-address>
...then there's a pretty solid chance your DNS cache is serving up stale, corrupted, or just flat-out wrong data. Your computer remembered an old IP for that server address, and now it's confidently pointing you in the wrong direction. It's one of those things that sounds complicated but is usually a five-second fix.
Why This Actually Happens
Your OS caches DNS lookups so it doesn't have to query a DNS server every single time you connect somewhere. That's normally a good thing — it speeds stuff up. But when a server's IP changes (hosting migrations, new providers, etc.), your local cache hasn't gotten the memo yet. The TTL on the old record might have expired, but your system is still holding onto it like it's gold.
Minecraft is particularly unforgiving about this because it doesn't do any real retry logic on hostname resolution failures. Some apps will quietly retry or fall back. Minecraft just goes "nope" and throws that wall of red text at you. I've seen this happen constantly with community servers that switch hosts, or even after a home router reboot that temporarily breaks local DNS resolution.
Fix 1: Flush DNS on Windows (This Fixes It 90% of the Time)
Open your Command Prompt as Administrator — hit the Windows key, type cmd, right-click, and choose "Run as administrator". Then run these two commands back to back:
ipconfig /flushdns
ipconfig /registerdns
You should see something like "Successfully flushed the DNS Resolver Cache". After that, close Minecraft completely (don't just close the server browser — actually quit the whole launcher), reopen it, and try connecting again.
While you're at it, you can also run:
netsh winsock reset
And then restart your PC. This resets the Windows socket layer, which sometimes gets wonky and contributes to these connection issues. Honestly, I do all three together now just out of habit.
Fix 2: Flush DNS on macOS
Mac users aren't immune to this. Open Terminal (Spotlight search → "Terminal") and run this — the specific command varies a bit by macOS version, but this one works on anything from Monterey onwards:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
You'll need to enter your password. No output after the command is totally normal — macOS stays quiet when things work. If you're on an older Mac running High Sierra or Mojave, the command is the same, so you're covered either way.
After running it, quit Minecraft fully and relaunch. Nine times out of ten, that's all it takes.
Fix 3: Flush DNS on Linux
Linux is a bit more scattered here because it depends on what DNS resolver you're running. Most modern distros use systemd-resolved, so try this first:
sudo systemd-resolve --flush-caches
Then verify it actually cleared:
sudo systemd-resolve --statistics
Look for "Current Cache Size: 0" in the output. If you're on an older setup running nscd instead, it's:
sudo service nscd restart
And if you're running dnsmasq:
sudo service dnsmasq restart
Pick whichever matches your setup. If you're not sure, try the systemd-resolve one first — it's the right answer on Ubuntu 18.04+ and most Debian-based distros running a modern kernel.
Fallback: Switch Your DNS Server Entirely
Here's the thing though — sometimes flushing the cache isn't enough if your ISP's DNS servers are just having a bad day. It happens more than ISPs would like to admit. The fix is to point your machine at a more reliable public DNS server.
Go into your network adapter settings (on Windows: Control Panel → Network and Sharing Center → Change adapter settings → right-click your connection → Properties → IPv4 → Properties) and set your DNS manually:
Preferred DNS: 1.1.1.1 (Cloudflare)
Alternate DNS: 8.8.8.8 (Google)
Or if you prefer to keep things in Google's ecosystem, flip those. Either way, both of these are dramatically more reliable than most ISP-provided DNS servers in my experience — and they tend to have much lower TTLs on cached records, which means you'll get fresh data faster when a server's IP changes.
After switching, flush your cache one more time using whichever command matches your OS above, restart Minecraft, and give it another shot.
(Side note: switching to Cloudflare's 1.1.1.1 also slightly improved my ping to some game servers back when I first set it up. Probably placebo, but I've stuck with it regardless.)
Still Not Working?
If you've flushed DNS, switched servers, and Minecraft still can't connect, double-check the server address itself. Ask whoever runs the server to confirm the current IP or hostname — especially if it's a domain-based address like play.someserver.net. You can verify DNS resolution yourself with:
nslookup play.someserver.net
That'll tell you exactly what IP address that hostname resolves to right now, and whether DNS is even seeing the server at all. If it comes back with no answer or a wildly wrong IP, the issue is on the server's DNS configuration side, not yours.
Hope this saves you the 45 minutes of Googling I spent the first time this happened to me at midnight.
Related: How to Fix "Failed to Connect to Server" in Minecraft (Actually Works in 2025)
๋๊ธ
๋๊ธ ์ฐ๊ธฐ