Configure Rust SRV Records to Preserve Player Favorites
Rust supports connections through a DNS hostname when the correct A and SRV records are configured. Combined with server.favoritesEndpoint , this lets.
Rust supports connections through a DNS hostname when the correct A and SRV records are configured. Combined with server.favoritesEndpoint, this lets players who favorite the server find it again after its IP address changes—or, with an SRV record, after its game port changes.
For additional discovery options, players can browse live game servers on LiveGameServerList.
This example uses play.example.com and game port 28015. Replace them with your server's actual hostname and server.port value.
1. Create the A record
Create an A record that points the public hostname to the Rust server's IPv4 address:
| Field | Example | |---|---| | Type | A | | Hostname | play.example.com | | Value | The server's public IPv4 address |
Facepunch specifies that hostname-based Rust connections require an A record pointing to the server's IPv4 address and an SRV record pointing to that A-record hostname.
2. Create the SRV record
Configure the SRV record with these values:
| Field | Value | |---|---| | Service | _rust | | Protocol | _udp | | Name | play.example.com | | Target | play.example.com | | Port | The server's server.port value |
For this example, the complete SRV name is:
_rust._udp.play.example.com
The target must be the hostname represented by the A record, and the port must match server.port. Facepunch also specifies that there must not be multiple SRV entries for the same Rust server.
DNS dashboards may arrange these fields differently. Facepunch's examples show Cloudflare combining the service, protocol, and name in one field, while GoDaddy provides separate fields.
3. Configure the favorites endpoint
Set the convar to the A-record hostname:
server.favoritesEndpoint play.example.com
Do not include the SRV service and protocol prefix:
server.favoritesEndpoint _rust._udp.play.example.com
Facepunch explicitly says that server.favoritesEndpoint should contain the A-record hostname, without _rust._udp. Players who favorite the server after this is configured can use that hostname to find it again following an IP change or, when SRV is used, a port change.
4. Use DNS-only mode with Cloudflare
If Cloudflare manages the DNS zone, configure the Rust game-server record as DNS only.
Cloudflare states that records used for game servers and other non-HTTP protocols must be DNS-only. Its ordinary proxy handles HTTP and HTTPS traffic and drops non-HTTP connections sent through it.
5. Verify both record types
BIND's dig utility accepts a DNS name followed by an explicit query type. Check the A and SRV records separately:
dig play.example.com A
dig _rust._udp.play.example.com SRV
Confirm that the A response contains the intended IPv4 address. In the SRV response, confirm that the target is play.example.com, the port matches server.port, and there is not more than one entry for the server.
Compact output is available with +short:
dig +short play.example.com A
dig +short _rust._udp.play.example.com SRV
The BIND documentation states that dig accepts an explicit query type and defaults to an A-record lookup when the type is omitted. Specifying A and SRV makes each verification query unambiguous.
Migration checklist
Before changing hosts:
- Point the A record at the destination server's public IPv4 address.
- Set the SRV target to the A-record hostname.
- Set the SRV port to the destination server's
server.portvalue. - Keep
server.favoritesEndpointset to the A-record hostname. - If using Cloudflare, keep the game-server record DNS-only.
- Query the A and SRV records separately and confirm their returned values.
Keeping these three values aligned—the A-record hostname, the SRV target and port, and server.favoritesEndpoint—allows Rust's favorites mechanism to locate the server after supported IP or port changes.
Sources and verification
- Server DNS Records — Rust WikiRust hostname connections require an A record and an SRV record. The SRV record uses the _rust service and _udp protocol, targets the A-record hostname with server.port, and must not have multiple entries for the same server. server.favoritesEndpoint uses the A-record hostname and supports IP and port changes without losing favorites.
- Proxy Status Use Cases — Cloudflare DNS DocumentationDNS records for game servers and other non-HTTP protocols must be DNS-only because Cloudflare's ordinary proxy handles HTTP and HTTPS traffic and drops non-HTTP connections.
- BIND 9 Manual Pages — digThe dig command accepts a resource-record name and explicit query type, displays returned DNS answers, and defaults to an A-record query when no type is supplied.
- Add server.favoritesEndpoint — Facepunch Commit 471250server.favoritesEndpoint stores a DNS hostname for favorites so the server browser can find the server after an IP change and, when SRV is used, a port change.
