All Products
Search
Document Center

ApsaraDB for MongoDB:Apply for and modify an SRV endpoint

Last Updated:Mar 28, 2026

SRV endpoints eliminate the need to update connection strings when nodes are added or removed. Clients connect to instances seamlessly, simplifying the design and maintenance of your application.

Prerequisites

Before you begin, make sure you have:

  • A replica set instance or sharded cluster instance with standard SSD storage

  • (For public SRV endpoints) A public endpoint already configured for the instance

Before you start

  • SRV endpoints are not shown in the console by default. You must apply for one before use.

  • Applying for or modifying an SRV endpoint takes 1–2 minutes to complete.

  • After modifying an SRV endpoint, update the connection string in your application promptly to avoid connection failures.

Apply for an SRV endpoint

  1. Go to the MongoDB replica set instance list or MongoDB sharded cluster instance list. Select the resource group and region, then click the target instance ID.

  2. In the left navigation pane, click Database Connections.

  3. Apply for the SRV endpoint based on your connection type: Private endpoint Click Privatelink - Virtual Private Cloud on the right, then click Apply For A Private SRV Endpoint. Public endpoint Click Public Connection on the right, then click Apply For A Public SRV Endpoint.

    Important

    You must apply for the instance's public endpoint before applying for a public SRV endpoint.

  4. In the Apply For An SRV Endpoint dialog box, click OK.

Modify an SRV endpoint

Use this procedure to change the connection address prefix of an existing SRV endpoint.

  1. Go to the MongoDB replica set instance list or MongoDB sharded cluster instance list. Select the resource group and region, then click the target instance ID.

  2. In the left navigation pane, click Database Connections.

  3. Open the modify panel based on your connection type: Private endpoint Click Privatelink - Virtual Private Cloud on the right, then click Modify Private SRV Endpoint. Public endpoint Click Public Connection on the right, then click Modify Public SRV Endpoint.

  4. Enter the new connection address prefix. The prefix must meet the following requirements:

    RequirementDetails
    Allowed charactersLowercase letters, digits, and hyphens (-)
    Start and end charactersMust be a lowercase letter or a digit
    Prefix lengthAt least 8 characters
    Total length (including prefix)No more than 63 characters
    UniquenessMust be globally unique
  5. Click OK.