# How to Set Up a Custom Domain for Your Minecraft Server (/docs/minecraft/custom-server-ip)



import { Step, Steps } from 'fumadocs-ui/components/steps';

A custom domain like `play.yourserver.com` is easier to share, looks more professional, and lets you change hosting providers later without your players needing a new IP. You set it up with two DNS records: an **A record** (maps domain → IP) and optionally an **SRV record** (lets you hide a non-default port).

> **Most-asked question:** Do I need an SRV record? **Only if your server uses a port other than 25565.** With the default port, an A record alone is enough.

What You Need [#what-you-need]

* A domain you own (Cloudflare, Namecheap, GoDaddy, Porkbun, etc.)
* Your server's **IP address and port** from the **Network** tab in the [XGamingServer Panel](https://panel.xgamingserver.com)
* Access to your domain's DNS management page

Set Up the Domain [#set-up-the-domain]

<Steps>
  <Step>
    Get your server IP and port [#get-your-server-ip-and-port]

    In the panel, click **Network** in the sidebar. Note:

    * **IP address** (e.g., `123.45.67.89`)
    * **Port** (e.g., `25565` — but it might be different)
  </Step>

  <Step>
    Log in to your registrar's DNS page [#log-in-to-your-registrars-dns-page]

    Go to your domain registrar (where you bought the domain) and find the **DNS** or **DNS Management** section.
  </Step>

  <Step>
    Create an A record [#create-an-a-record]

    Add a new record with these settings:

    | Field                         | Value                                                                         |
    | ----------------------------- | ----------------------------------------------------------------------------- |
    | **Type**                      | A                                                                             |
    | **Name / Host**               | `play` (or whatever subdomain you want — `mc`, `server`, `@` for root domain) |
    | **Value / Target**            | Your server's numeric IP from step 1                                          |
    | **TTL**                       | Auto, or `3600` (1 hour)                                                      |
    | **Proxy** *(Cloudflare only)* | **DNS only** (grey cloud) — never proxied                                     |

    > **Cloudflare warning:** If you use Cloudflare DNS, the record **must** be set to **DNS only** (grey cloud). Cloudflare's HTTP proxy (orange cloud) cannot tunnel Minecraft traffic. Players will get connection errors if it's proxied.
  </Step>

  <Step>
    (Optional) Create an SRV record for non-default ports [#optional-create-an-srv-record-for-non-default-ports]

    **Skip this step if your port is 25565.** If your port is anything else and you want players to connect *without* typing the port, add:

    | Field           | Value                                            |
    | --------------- | ------------------------------------------------ |
    | **Type**        | SRV                                              |
    | **Name / Host** | `_minecraft._tcp.play`                           |
    | **Service**     | `_minecraft`                                     |
    | **Protocol**    | `_tcp`                                           |
    | **Priority**    | `0`                                              |
    | **Weight**      | `5`                                              |
    | **Port**        | Your actual server port                          |
    | **Target**      | `play.yourserver.com` (the A record you created) |
    | **TTL**         | Auto, or `3600`                                  |

    Now players can connect with just `play.yourserver.com` — no port needed.
  </Step>

  <Step>
    Wait for DNS propagation [#wait-for-dns-propagation]

    DNS changes can take **15 minutes to 48 hours** to propagate worldwide. Most providers update in 5–30 minutes.

    Test propagation with:

    ```
    nslookup play.yourserver.com
    ```

    The IP returned should match your panel's Network IP.
  </Step>

  <Step>
    Test in Minecraft [#test-in-minecraft]

    Open Minecraft → **Multiplayer** → **Add Server**, and enter `play.yourserver.com`. The server should appear with full ping.
  </Step>
</Steps>

A Record vs SRV Record [#a-record-vs-srv-record]

| Use case                                | Records you need                |
| --------------------------------------- | ------------------------------- |
| Default port 25565                      | A record only                   |
| Non-default port, players type the port | A record only                   |
| Non-default port, hide it from players  | A record + SRV record           |
| Multiple servers behind one domain      | A record + multiple SRV records |

Cloudflare-Specific Setup [#cloudflare-specific-setup]

Cloudflare is the most common gotcha. The required settings:

| Setting      | Value                     |
| ------------ | ------------------------- |
| Record type  | A                         |
| Proxy status | **DNS only** (grey cloud) |
| TTL          | Auto                      |

If you see the orange cloud icon, click it to toggle to grey. Otherwise the connection silently fails.

For SRV records on Cloudflare, use Cloudflare's split SRV form (Service, Protocol, Name fields are separate — don't combine them into one).

Common Mistakes [#common-mistakes]

| Mistake                                        | Fix                                             |
| ---------------------------------------------- | ----------------------------------------------- |
| Cloudflare orange cloud (proxied)              | Toggle to grey cloud (DNS only)                 |
| A record points to old IP                      | Update value to current panel IP                |
| SRV record's Target doesn't match the A record | They must match exactly                         |
| Forgot to wait for propagation                 | Wait 15–30 minutes minimum                      |
| Used `https://` or `www.` in the value         | Just the IP — no protocol prefix                |
| Players still type the port                    | They cached the old address — clear server list |
| Used wrong subdomain in SRV Name               | Must be `_minecraft._tcp.<your_subdomain>`      |

Verify with Online Tools [#verify-with-online-tools]

* [https://dnschecker.org](https://dnschecker.org) — see propagation across the world
* [https://mcsrvstat.us](https://mcsrvstat.us) — checks both A and SRV records and pings the server

Related Guides [#related-guides]

* [SRV Record Setup](/docs/minecraft/srv-record)
* [Connect to Your Server](/docs/minecraft/join-server)
* [Server Properties](/docs/minecraft/server-properties)
* [Fix: Connection Timed Out](/docs/minecraft/fix-connection-timed-out)
