How to Set a Custom Domain to Connect to a Valheim Server

From Survival Servers
Jump to navigation Jump to search

To join your Valheim server, on PC or Xbox, without typing the IP each time, set a custom domain or subdomain for it.

Unlike Minecraft, Valheim doesn't read SRV records, so this only points a subdomain at your server's IP. Players type the subdomain in the game's Add server box. When the port isn't 2456, they add a colon and the game port (for example play.mydomain.com:4956). Example:

Valheim Join IP box with play.mydomain.com typed in, above the Cancel and Connect buttons.

Setting up the DNS record

You need a domain of your own, with its DNS settings on Cloudflare.

  1. Sign up for a Cloudflare account and fully set up your domain there.
  2. On your domain's page in Cloudflare, go to DNS > Records.

Using a subdomain (play.mydomain.com)

  1. Click the Add record button.
  2. Set the following:
    • Type: A
    • Name: play.mydomain.com
    • For the IPv4 address, copy the IP from the Game Server page in the Command Center (the part of ADDRESS before the colon):
    Server details block with the Address (IP and port) row outlined in gold, FTP details beside it and the Valheim join code box below.
    The IP is the part of the address before the colon.
    • IPv4 address: 203.0.113.10 in this example. Use your own server's IP.
    • Uncheck the Proxy status.
    Cloudflare record row with an arrow pointing at the orange Proxied cloud under Proxy status.
  3. Click Save. The subdomain now points to your server's IP address.
  4. Valheim doesn't read SRV records, so there's no port record to add. Copy the Game Port from the Game Server page instead (the number after the colon in ADDRESS, or Game Port in the window the small "i" next to it opens). Players type it after your subdomain:
    IP and Port Information window listing the IP address, the game port for direct connect and the query port for the Steam list.
    Players type the Game Port after your domain.

Using a domain (mydomain.com)

  1. IMPORTANT: If there's already an A record (the Type column) for mydomain.com, delete it. Here mydomain.com stands for your own domain.
  2. Click the Add record button.
  3. Set the following:
    • Type: A
    • Name: mydomain.com
    • For the IPv4 address, copy the IP from the Game Server page in the Command Center (the part of ADDRESS before the colon):
    Server details block with the Address (IP and port) row outlined in gold, FTP details beside it and the Valheim join code box below.
    The IP is the part of the address before the colon.
    • IPv4 address: 203.0.113.10 in this example. Use your own server's IP.
    • Uncheck the Proxy status.
    Cloudflare record row with an arrow pointing at the orange Proxied cloud under Proxy status.
  4. Click Save. The domain now points to your server's IP address.
  5. Valheim doesn't read SRV records, so there's no port record to add. Copy the Game Port from the Game Server page instead (the number after the colon in ADDRESS, or Game Port in the window the small "i" next to it opens). Players type it after your domain:
    IP and Port Information window listing the IP address, the game port for direct connect and the query port for the Steam list.
    Players type the Game Port after your domain.

Joining a Valheim server with a custom domain (or subdomain)

  1. Start the game and click the Start Game button.
  2. Select a character from the character selection screen and click Start.
  3. Click the Join Game tab at the top.
  4. Click the Add server button and type in your domain (or subdomain), followed by a colon and the game port, for example play.mydomain.com:4956 (you can leave the port off only when it's 2456). Then click Connect.
    Valheim Join IP box with play.mydomain.com typed in, above the Cancel and Connect buttons.

Rent a Valheim server from Survival Servers and be online in minutes.