diff --git a/source/connect/connection-targets.txt b/source/connect/connection-targets.txt index 9ee5b932..12de24ad 100644 --- a/source/connect/connection-targets.txt +++ b/source/connect/connection-targets.txt @@ -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: @@ -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:///" + +To learn more about the SRV connection format, see the :manual:`SRV Connection Format ` +entry in the {+mdb-server+} manual. + Troubleshooting ---------------