4FreeForumsFree forum softwareStart a forum

Matrix Federation Delegation Profile: Well-Known JSON vs. DNS SRV Records

By 4FreeForums Editors · Published October 30, 2026 · Sources linked below

Matrix Federation Delegation Profile: Well-Known vs. DNS SRV

Running a Matrix homeserver alongside an existing community domain requires routing server-to-server traffic effectively. In decentralized communication setups, administrators often want user handles that align with their primary apex domain without hosting the backend daemon directly on that base address. According to the Delegation - Synapse documentation, homeservers resolve these connection targets using either HTTP-based delegation or DNS SRV records.

At a Glance: The Federation Routing Baseline

Matrix identifies servers using a configuration value known as server_name. This name forms the suffix of user identifiers and room aliases, indicating to remote instances where federation requests should go. By default, federating homeservers attempt to discover and establish connections with target domains on port 8448 over HTTPS.

If an organization registers example.com, user addresses follow the format @user:example.com. In a standard setup without delegation, remote instances attempt to reach that server directly at https://example.com:8448/. When hosts wish to keep addresses matching *:example.com while transferring traffic to a dedicated target like synapse.example.com:443, they implement federation delegation.

The Well-Known JSON Delegation Mechanism

The primary delegation method relies on serving a structured JSON file over standard web traffic. A server positioned at the base domain serves this file over port 443 at the endpoint path https://<server_name>/.well-known/matrix/server. The payload supplies the federation target using the m.server key:

{ "m.server": "synapse.example.com:443" }

Supplying the target port inside the value string is optional; if the port is left out, federation requests automatically default back to port 8448. Community administrators running systems like those reviewed in our Synapse Matrix Homeserver Profile can deploy this file through two architectural paths:

The DNS SRV Record Alternative and Its Constraints

The Matrix specification also allows federation routing via DNS SRV records. Rather than querying an HTTPS endpoint on port 443, remote homeservers query DNS zone entries to determine the target host and port for server-to-server handshakes. Despite being technically viable, this approach is generally not recommended by official Synapse documentation.

The primary barrier with SRV records involves TLS certificate validation. Configuring matching certificates correctly across federating hosts can prove difficult when routing across distinct record targets. Furthermore, DNS delegation provides minimal practical advantage compared to the simplicity of serving a lightweight JSON document.

Crucially, DNS SRV delegation only resolves server-to-server traffic. It provides no mechanism for client-server communication. Global client settings—such as assigning a default Jitsi endpoint or ensuring new rooms are not created as encrypted by default—require client-facing files served from spec-defined .well-known paths on the apex domain. Relying exclusively on SRV records deprives administrators of centralized client configurations, leaving settings to the standalone feature sets of individual user clients.

Architectural Comparison: JSON File vs. DNS SRV

When selecting a delegation strategy for community infrastructure, administrators weigh distinct trade-offs between transport layers:

When Delegation Is Not Required

Homeservers do not always need delegation. According to the Delegation - Synapse documentation, if an admin points the base DNS A record of example.com straight to a dedicated host, runs Synapse there, and routes port 8448 through a reverse proxy serving TLS certificates for example.com, no delegation is necessary. Delegation is only required when the public API cannot reside on port 8448 of the domain defined by the server_name setting.

Sources

Delegation - Synapse

Published October 30, 2026. No affiliate links on this page. Facts come from the sources linked above; check them for updates.