JoinGG

How to Connect to a Game Server by IP Address

Direct connect, game by game: what a server address is made of, why the port is not optional, and why an address can work for a friend but not for you.

SweetMask · 15 min read

Every multiplayer game ships with some kind of server browser, and every one of those browsers eventually fails you. A friend sends you an address in a Discord message. A community posts its address on a forum thread. A server you played on last week has vanished from the list because its heartbeat to the master server dropped out for twenty minutes. In all of those cases the fix is the same: you type the address in yourself and connect directly, skipping the browser entirely.

Direct connect is older than server browsers. It is the underlying mechanism that browsers wrap. When you click a row in a list, the game does not do anything magical — it reads the address stored in that row and issues the same connect command you could have typed. Understanding this makes a lot of multiplayer troubleshooting easier, because once you can connect by hand you can separate two very different problems: "the server is unreachable" and "the server is fine but the browser is not showing it".

This guide covers how to do it in the games where people ask about it most, and then covers the reasons it sometimes does not work.

Reading an address before you type it

A server address has two parts joined by a colon. On the left is the host — either a raw IP address in the familiar four-numbers-with-dots form, or a hostname like play.example.com. On the right is the port, a number that tells the machine at that address which of the many programs running on it should receive your traffic.

One physical machine can run several game servers at once. They all share the same IP. The port is what distinguishes them. This is why the port is not decoration and not optional when it has been published: if someone gives you an address with a port and you drop the port, you are not connecting to a slightly different version of the same server, you are asking a machine to route you somewhere that may have nothing listening at all.

There is a wrinkle that causes real confusion. Most games have a default port, and most games will silently append it if you leave the port off. So sometimes typing just the host works fine — because the server happens to be on the default. And sometimes it fails completely, because the server operator moved it, usually because they are running several servers on one box. You cannot tell which situation you are in by looking. The rule that always works: type the address exactly as it was given to you, colon and port included. Do not tidy it up.

Watch out for characters that survive a copy and paste but should not be there. A trailing full stop from the end of a sentence. A space you did not notice. A comma instead of a colon. Some chat clients turn an address into a clickable link and quietly mangle it. If a connect attempt fails instantly rather than hanging while it tries to reach something, the address itself is malformed and no amount of retrying will help.

Server listing sites exist partly to save you from all of this. A good listing gives you the full address in copyable form and tells you whether the server responded to a query recently, which is a more useful signal than "it was in the list". What makes a server listing trustworthy goes into what to check.

Source engine games: Counter-Strike, Team Fortress 2 and friends

Games built on Valve's Source engine share one connect method, which is convenient because there are a lot of them. Counter-Strike 2, Counter-Strike: Source, Team Fortress 2, Garry's Mod, Left 4 Dead 2 and Half-Life all work the same way, through the developer console.

The console is hidden by default, so the first step is turning it on. Open the game's settings, find the keyboard or advanced options, and enable the developer console. Exactly where this lives has moved around over the years and between titles, but it is always in settings and it is always a single toggle. Once enabled, the tilde key opens it. On keyboard layouts where tilde is awkward or produces a dead key, you can rebind the console key in the same settings area — worth doing rather than fighting your keyboard every time.

With the console open, the command is:

connect address:port

Type connect, a space, then the address exactly as given. Press Enter. The console will close and the game will start loading, or it will print an error and leave you where you are.

If the server has a password, you set it before connecting rather than waiting to be asked:

password yourpassword
connect address:port

Order matters. The password has to be set in advance because it is sent as part of the connection handshake, not typed into a prompt afterwards. Some communities password their servers deliberately so that only people who read the rules page get in.

Two console details that save time. It keeps a history — press the up arrow to bring back the last command instead of retyping a long address. And retry reconnects to the last server you were on, which is genuinely useful when a server restarts and you want back in ahead of everyone waiting for their browser to refresh.

If you are on the newer Counter-Strike and the console will not appear even after enabling it, -console as a launch parameter forces it. Getting the game installed and configured is covered in the Counter-Strike 2 beginner guide, and the CS2 server list and Counter-Strike: Source list show what communities are actually running on each.

Team Fortress 2 is identical in method. Enable console, type connect, done. Because TF2 community servers run such varied configurations, direct connect gets used a lot there — people share addresses for specific servers rather than telling you to go hunting. The TF2 server list is a reasonable place to find addresses in the first place. The same applies to Garry's Mod, where a large fraction of servers run gamemodes that will not appear meaningfully in a generic browser listing, and Left 4 Dead 2, where community servers are the alternative to matchmaking.

If Steam itself is new to you, the Steam installation guide covers the platform side.

Counter-Strike 1.6 and the older GoldSrc games

Counter-Strike 1.6 predates Source but the console works the same way, because Source inherited the console from GoldSrc rather than inventing it. Enable the console in options, open it with tilde, type connect address:port.

The one difference worth knowing is that 1.6 servers are more likely to be running on non-default ports, because the people who host them have often been hosting multiple servers on one machine for a very long time. Take the port seriously. The community around 1.6 is small enough that addresses circulate by word of mouth and forum post more than through browsers, which makes direct connect the normal way in rather than the fallback. There is a fuller treatment of that scene in the Counter-Strike 1.6 servers guide, and current addresses on the CS 1.6 server list. Half-Life servers work identically and are listed at /servers/game/hl.

Minecraft: the Add Server dialogue

Minecraft has no console for this and does not need one, because joining by address is the primary way you play multiplayer. There is no matchmaking to fall back on.

From the main menu, choose Multiplayer. You get a list of servers you have saved, and below it two buttons: Add Server and Direct Connection. Add Server saves the entry so it appears in your list from now on. Direct Connection joins once without saving, which is what you want for a server you are trying out or visiting for a one-off event.

Either way you paste the address into the field. Minecraft has a default port and will use it if you leave the port off, which is why so many Minecraft addresses look like a bare domain name with nothing after it. Hosts often go further and configure DNS so that even a non-default port is resolved automatically. But if a host has given you a port explicitly, include it. They had a reason.

A detail specific to Minecraft: the saved server entry shows a ping and a player count once it resolves, and it shows a version mismatch warning if the server is running a different game version from your client. That warning is the most common reason a Minecraft connection fails. The address is fine, the server is up, and your client is simply the wrong version. The fix is switching your installation to the matching version rather than anything to do with the address. The Minecraft installation guide covers version handling, and the Minecraft server list has addresses along with the version each server runs.

Modded servers add another layer. If a server runs a mod loader, your client needs the same loader and usually the same mod set. A vanilla client pointed at a modded server will connect far enough to be rejected, and the rejection message is often vague.

FiveM handles this differently from everything else here, because it has its own client layer sitting on top of GTA V.

The in-client console opens with F8. The command is:

connect address:port

Same shape as Source, different key to get there. FiveM pulls down the server's resource files before dropping you in, so the first connection to any server takes noticeably longer than later ones — that is not a stall, it is the download.

FiveM also supports join links. Servers registered with the platform get a short code, and a link built from that code launches your client and connects you when opened in a browser. This is what most FiveM communities publish, because it removes address handling entirely. The code is tied to the server's registration rather than its IP, so the operator can move hosts and the link keeps working. Prefer the link when one exists.

When a FiveM connection hangs partway through, it is usually resource downloads rather than the connection itself. Fixing FiveM server lag covers what goes wrong on the server side, and FiveM artifact updates and server queries covers the version mismatches between client and server artifacts that produce confusing failures. New to the platform? Start with the FiveM installation guide, then browse the FiveM server list.

Rust: the F1 console

Rust puts its console on F1. Open it, and you get a console panel with a command input at the bottom. The command is the same word everyone else uses:

client.connect address:port

Rust accepts connect on its own in most builds, but client.connect is the fully qualified form and is the one that reliably works across versions. If one does nothing, try the other.

Rust servers move around more than most, because wipe cycles and host changes are normal parts of how the game is run. An address that worked last month may point at nothing now, and that is not a fault on your end. Check the Rust server list for a current address rather than assuming the old one is still good. The Rust installation guide covers first-time setup.

Why an address works for your friend but not for you

This is the most common frustrating case, and there are several distinct causes that look identical from where you are sitting.

The server may be region-locked or whitelisted. Some operators restrict connections by country or by an allow-list of accounts, usually to control cheating or to keep a private community private. Your friend is on the list. You are not. The failure looks like a generic timeout.

Your game version may differ. Your friend updated last week, or did not, and the server matches them and not you. Minecraft is the obvious case but every game with an update cycle has this.

Something on your side may be blocking the traffic. Corporate networks, university halls and some mobile hotspots block the port ranges games use. Your home firewall or antivirus may also be dropping it. A quick test: try connecting through a phone hotspot. If it works there and not on your usual network, the network is the problem rather than the address.

The server may simply have been full at the moment you tried. Some games queue you, others reject you outright with a message that reads like a connection failure.

And it may be the address after all. Your friend may have retyped it from memory, or may be connecting via a saved favourite that holds a different address from the one they told you.

Hostnames, raw IPs and DNS

A hostname like play.example.com is not an address in itself. It is a name that gets looked up, through DNS, and turned into an IP before anything connects. That extra step is a feature — the operator can change which machine the name points to without anyone needing a new address — but it is also a place where things break.

If a hostname fails and the raw IP works, the problem is name resolution, not the server. Your DNS resolver may be caching an old answer, or the operator may have changed the record recently and it has not propagated to you yet. Waiting is often the actual fix, though changing your DNS resolver will shortcut the cache.

The reverse case also happens. An IP that worked stops working while the hostname still resolves fine, because the server moved and only the name was updated. This is exactly why operators publish hostnames rather than IPs, and why you should save the hostname in your favourites when you are given one.

Do not paste addresses from sources you do not trust

Connecting to a game server hands a stranger's machine your IP address. That is unavoidable and normally harmless — it is true of every server you have ever played on. The real concern is narrower.

Some game clients accept more than a plain address in their connect field. Console commands can be chained, and a string that looks like an address may carry extra commands after it. Pasting a long, odd-looking string into a console is not the same as typing an address. Look at what you are pasting. If it contains semicolons, quotation marks or command words beyond the address itself, do not run it.

Be sceptical of addresses that arrive with pressure attached — a DM claiming a limited-time event, a link promising rewards for joining. Servers that harvest IPs for later abuse are a real if uncommon thing, and the pattern is always social rather than technical: someone talks you into connecting somewhere you had no reason to go.

Addresses from an established listing, a community's own site, or people you actually know are fine. That is the whole of the advice. How to find the best game servers in 2026 covers evaluating servers beyond just whether they are reachable.

When direct connect works but the browser never shows the server

You connect by IP without trouble. The server is up, it plays fine, and yet searching for its name in the in-game browser turns up nothing. This confuses people into thinking something is wrong with their client. Usually nothing is.

In-game browsers get their listings from master servers, and a game server has to register itself and keep sending heartbeats to stay listed. If that registration fails — a misconfiguration, a firewall rule blocking the query port, a master server having a bad day — the game server keeps running and accepting players perfectly well while being invisible to the browser. Direct connect bypasses the entire listing mechanism, which is why it still works.

Query ports are a common culprit. Many games use one port for gameplay and a separate one for answering "who are you and how many players do you have" queries. An operator can forward the game port and forget the query port. Result: playable server, empty listing.

Some browsers also filter aggressively by default. Full servers, empty servers, passworded servers — all can be hidden by filters you did not knowingly set. Clearing every filter before concluding a server is missing is worth the ten seconds.

If you run a server and this is your situation, it is fixable, and it is the leading reason a good server sits empty. Why nobody joins your server works through the discoverability side. Listing the server somewhere that queries it directly rather than relying on the game's master server also helps — that is much of the point of what JoinGG does.

The practical habit: when a server you like goes missing from the browser, save its address rather than assuming it is gone. Favourites lists in most games store the raw address and connect directly, so a favourited server stays reachable through listing outages that make it vanish for everyone browsing.

Common questions

Do I always need the port? No, but you should always include it when you have been given it. Games fill in a default port when you leave it off, and plenty of servers do run on the default. Servers that share a machine with other servers do not, and there is no way to tell by looking at the address which case you are in.

Why does my connection time out with no error message? A timeout means your client sent packets and nothing came back. The server may be offline, the address may point somewhere with nothing listening, or something between you and it is dropping the traffic. It is the least informative failure because all three look the same. Test with a different network if you can.

Can I connect to a server that is not in any browser? Yes. Direct connect does not consult a listing at all, so a server that has failed to register with its master server is still reachable if you know the address. This is the main reason to learn the method.

Should I save the hostname or the IP? The hostname, whenever one is offered. It survives the operator moving to a different machine, which a raw IP does not.

Does connecting directly hurt my ping? No. Direct connect and browser connect produce identical connections — the browser just types the command for you. Your ping is a function of the network path and the distance, not how you initiated the connection.

What if the game asks for a password and I do not have one? The server is private and you need to get the password from whoever runs it, usually via their Discord or website. There is no way around it, and the password is checked server-side.

Is it safe to give someone my server's IP? For a public game server, yes — it is public by design and appears in listings anyway. Be more careful about your own home IP if you are hosting from home, since that exposes your household connection rather than a rented machine.

The address is right but I get a version mismatch. Your client and the server are on different game builds. Match the server's version rather than trying to fix the connection. In Minecraft you switch installation versions; in FiveM the server's artifact version is the thing to look at; in Steam games it is usually an update you have not applied yet, or a beta branch one of you is on.

If none of this gets you in, browsing the full server list for an alternative running the same game is often faster than debugging a single unreachable address.

Common questions

Why does a direct connection attempt fail instantly instead of hanging?
An instant connection failure means the address itself is malformed. This usually happens when characters like trailing spaces, full stops, or commas are accidentally included during copy and paste, or when a chat client mangles the link.
How can you tell if a local network is blocking a game server connection?
You can test your connection by switching to a mobile phone hotspot. If the server connects over the hotspot but fails on your primary network, a firewall, corporate filter, or network restriction is blocking the required ports.
What should you do if a hostname fails to connect but the raw IP works?
You should either wait for the record to propagate or change your DNS resolver. This issue occurs when DNS name resolution fails or your resolver is caching an outdated record after an operator updates their machine details.
Tags
direct connectip addressserver portconsole commandsjoining servers
Share

SweetMask

Published · 15 min read

All articles

Keep reading