Skip to content
Merged
Changes from all 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
19 changes: 18 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,23 @@ 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. Additionally, if you enable
the SRV connection format, {+driver-short+} automatically re-scans for new hosts without
having to change the client configuration.

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>`
entry in the {+mdb-server+} manual.

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

Expand Down
Loading