Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion source/connect/connection-targets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Choose a Connection Target
:values: reference

.. meta::
:keywords: connection string, URI, server, settings, client, load balancing
:keywords: connection string, URI, server, settings, client, load balancing, srv, dns

.. contents:: On this page
:local:
Expand Down Expand Up @@ -151,6 +151,20 @@ option to ``True``. You can do this in two ways: by passing an argument to the
"directConnection=true")
client = MongoClient(uri)

DNS Service Discovery
---------------------

To use DNS service discovery to look up the DNS SRV record of the service you're connecting to,
specify the SRV connection format in your connection string. The following code shows
a connection string that uses the SRV connection format:

.. code-block:: python

uri = "mongodb+srv://<hostname>/"

To learn more about the SRV connection format, see the :manual:`SRV Connection Format </reference/connection-string/#std-label-connections-dns-seedlist>`
guide in the {+mdb-server+} manual.

Troubleshooting
---------------

Expand Down
Loading