Skip to content

JAVA-6235: Configurable DNS domain validation for SRV records - #2054

Open
apmasell wants to merge 4 commits into
mongodb:mainfrom
apmasell:JAVA-6235
Open

apmasell wants to merge 4 commits into
mongodb:mainfrom
apmasell:JAVA-6235

Conversation

@apmasell

Copy link
Copy Markdown

Add support for srvAllowedHostsSuffix using the public suffix list as a deny list as a safeguard and add docs explaining the use of this parameter (and its potential security implications when used).

rozza and others added 2 commits September 14, 2026 15:51
Add a MongoClient-level `srvAllowedHostsSuffix` option that overrides the
domain inferred from the SRV host name when validating the hosts returned by
an SRV lookup. The value is normalized at configuration time (a leading "."
is prepended if absent, so the stored and returned value always begins with
"."), and every resolved host must end with it, matched case-insensitively;
otherwise the existing inferred-domain validation is unchanged. The option is
parsed from the connection string, carried on ClusterSettings, rejected on
non-mongodb+srv URIs, rejected when it contains whitespace, no domain label,
or an empty domain label, and threaded through the internal DNS resolution
path. It is supported with both multi-server and load-balanced SRV connection
strings, which now also apply srvServiceName consistently.

JAVA-6233
@apmasell
apmasell requested a review from nhachicha September 15, 2026 17:56
@apmasell
apmasell requested a review from a team as a code owner September 15, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants