@@ -244,8 +244,32 @@ query the DNS for the record to determine which hosts are running the
244
244
(or the equivalent :urioption:`ssl`) option to ``false`` with
245
245
``tls=false`` (or ``ssl=false``) in the query string.
246
246
247
- The following example shows a typical connection string for a DNS
248
- :term:`seed list` connection string:
247
+ When using the ``+srv`` format, you must specify the ``hostname``,
248
+ ``domain``, and ``top-level domain (TLD)`` in the following format:
249
+ ``<hostname>.<domain>.<TLD>.`` This table shows how the placeholders
250
+ correspond to example values:
251
+
252
+ .. list-table::
253
+ :header-rows: 1
254
+ :widths: 50 50
255
+
256
+ * - Placeholder
257
+ - Example
258
+
259
+ * - ``<hostname>``
260
+ - ``server``
261
+
262
+ * - ``<domain>``
263
+ - ``example``
264
+
265
+ * - ``<TLD>``
266
+ - ``com``
267
+
268
+ * - ``<hostname>.<domain>.<TLD>``
269
+ - ``server.example.com``
270
+
271
+ This example shows a DNS :term:`seed list` connection string that
272
+ correctly uses the ``<hostname>.<domain>.<TLD>`` format.
249
273
250
274
.. code-block:: none
251
275
@@ -259,6 +283,9 @@ The corresponding DNS configuration might resemble:
259
283
_mongodb._tcp.server.example.com. 86400 IN SRV 0 5 27317 mongodb1.example.com.
260
284
_mongodb._tcp.server.example.com. 86400 IN SRV 0 5 27017 mongodb2.example.com.
261
285
286
+ Individual SRV records must be in
287
+ ``_mongodb._tcp.<hostname>.<domain>.<TLD>`` format.
288
+
262
289
When a client connects to a member of the :term:`seed list`, the client
263
290
retrieves a list of replica set members it can connect to. Clients
264
291
often use DNS aliases in their seed lists which means the host may
@@ -275,6 +302,17 @@ replica set config.
275
302
the parent domains and hostname do not match, you will not be able to
276
303
connect.
277
304
305
+ This example shows a DNS seed list connection string that is missing
306
+ the ``<hostname>``. This is incorrect and raises an error.
307
+
308
+ .. code-block:: none
309
+ :copyable: false
310
+
311
+ # This connection string is missing the <hostname> and raises a connection error
312
+
313
+ mongodb+srv://example.com/
314
+
315
+
278
316
Like the standard connection string, the DNS seed list connection string
279
317
supports specifying options as a query string. With a DNS seed list
280
318
connection string, you can *also* specify the following options via a
0 commit comments