# Show your domain in the FiveM server list
This guide shows how to give your FiveM server a name such as `play.example.com`, so that:

- players can join with `connect play.example.com` in the F8 console, and
- the in-game server list hands players that name instead of your server's IP address.

These are two separate things in FiveM, and each needs its own step.

## How FiveM finds your server

There are two different ways players reach a FiveM server:

1. **Typing `connect <name>` in the F8 console.** This uses DNS. The game looks up an SRV record (`_cfx._udp.<your-name>`) to find the port and an A record to find the IP address, then connects. The FiveM server list is not involved.
2. **Clicking your server in the in-game server list.** This goes through the Cfx.re server list. The list contacts your server regularly to read its details, and when a player clicks **Connect**, the list tells the game where to connect.

DNS records only help with the first way. To change what the server list hands out, you also need two lines in your `server.cfg`.

## Step 1: give your server a name

You need a domain of your own, with a name that points at your server's address. Your server's IP address and port are on the **External Access** page (in your server's side menu), in the **How players join** card.

Add these two records at your domain provider (where you manage the domain's DNS). In this example the name is `play.example.com`:

| Type | Name | Value |
|---|---|---|
| A | `play` | Your server's IP address |
| SRV | `_cfx._udp.play` | Priority `0`, weight `0`, port: your server's port, target: `play.example.com` |

The exact form differs between providers. Some ask for the service (`_cfx`), protocol (`_udp`) and name in separate fields.

These records are yours: if your server's IP address or port ever changes, update them yourself.

Once the records are live, players can join with `connect play.example.com`, no port needed.

## Step 2: show the name in the server list

Add these lines near the top of your `server.cfg`, with your own name and port:

```cfg
# Do not publish the server's IP address in the server list
sv_forceIndirectListing true

# Where the server list contacts the server, and where it sends players
sv_listingHostOverride "http://play.example.com:<your-port>/"
```

Use the full form, with `http://` and the port:

- `http://` because the server answers on plain HTTP, not HTTPS.
- The port is your server's port from the **How players join** card. Without it, the server list tries port 80, where your server does not answer, and the listing fails.

Where to find `server.cfg` is explained in [Recommended FiveM server.cfg settings](/fivem/recommended-config#where-to-edit-servercfg). Restart the server after saving. The server list usually picks up the change within a few minutes.

### Why both lines are needed

- **`sv_forceIndirectListing true`** stops the server list from publishing your IP address. Without it, the list keeps handing players the raw IP, whatever else you set.
- **`sv_listingHostOverride`** does two jobs at once: it is the address the server list contacts to read your server's details, and, with indirect listing on, the address it gives players who click **Connect**. That is why it must be reachable from the internet.

You do not need `sv_listingIpOverride`: the platform writes it for you on every start. You only need `sv_endpoints` if you run your own proxy (see below).

## Check that it works

### 1. Open your server's details in a browser

These addresses should all answer with JSON:

- `http://<your-name>:<your-port>/info.json`
- `http://<your-name>:<your-port>/players.json`
- `http://<your-name>:<your-port>/dynamic.json`

If one of them does not load, the server list cannot reach you either. Check that the name points at the right IP address and that the address in `sv_listingHostOverride` matches.

### 2. Look at the console

Open **Console** in your server's side menu. If you see `Server list query returned an error`, the server list could not reach the address yet. Right after a start this is often harmless; see [Why your console shows "Server list query returned an error"](/fivem/server-list-stale-endpoint).

### 3. Check the public server list data

Open `https://servers.fivem.net/api/servers/single/<your-cfx-id>`. Your Cfx.re ID is the short code at the end of your server's link in the server list. Look for `connectEndPoints`: once the change has gone through, it shows your name, not the IP address.

## Common mistakes

- **Leaving out `http://` or the port** in `sv_listingHostOverride`. The server list then tries the wrong port and fails.
- **Forgetting `sv_forceIndirectListing true`.** The IP address keeps showing in the list.
- **Expecting DNS records alone to change the server list.** They only make `connect <name>` work. The server list follows `server.cfg`.
- **Not waiting.** DNS changes and the server list both take a few minutes to catch up.

## Advanced: your own reverse proxy

The setup above keeps your IP address out of the server list, but someone who knows how can still find it. If you want to hide it fully, you can run your own reverse proxy (for example nginx on a separate machine) in front of the server. This runs on your own infrastructure, so you set it up and maintain it yourself.

An example based on the [Cfx.re proxy setup guide](https://docs.fivem.net/docs/server-manual/proxy-setup/):

```nginx
# HTTP: 443 on the proxy, forwarded to the server's port
upstream fivem_http {
    server <your-server-ip>:<your-port>;
}

server {
    listen 443 ssl http2;
    server_name play.example.com;

    ssl_certificate     /etc/letsencrypt/live/play.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/play.example.com/privkey.pem;

    location / {
        proxy_pass http://fivem_http;
        proxy_set_header Host             $host;
        proxy_set_header X-Real-IP        $remote_addr;
        proxy_set_header X-Forwarded-For  $remote_addr;
        proxy_http_version 1.1;
    }
}

# Game traffic: TCP and UDP 30120 on the proxy, forwarded to the server's port
stream {
    upstream fivem_game {
        server <your-server-ip>:<your-port>;
    }
    server {
        listen 30120;
        proxy_pass fivem_game;
    }
    server {
        listen 30120 udp reuseport;
        proxy_pass fivem_game;
    }
}
```

With the proxy in place, `server.cfg` becomes:

```cfg
sv_forceIndirectListing true
sv_listingHostOverride  "https://play.example.com/"
sv_endpoints            "<your-proxy-ip>:30120"
sv_proxyIPRanges        "<your-proxy-ip>/32"
```

Two things to keep in mind:

- Point the name at your **proxy**, not at the server.
- `sv_proxyIPRanges` is required. Without it the server ignores the real player addresses the proxy passes on, and its per-address connection limit treats every player as one address.

## When to contact support

Contact support if the addresses under [Check that it works](#check-that-it-works) open in a browser, but:

- the server list still shows the raw IP address, or
- `connectEndPoints` keeps going back to the IP address after a restart.

Send your `server.cfg` with `rcon_password` and the license key removed, your Cfx.re ID, and the link to your server's page in the dashboard.
