Azure MongoDB vCore (DocumentsDB) not registered at Azure DNS service

Iñigo Martinez Lasala 20 Reputation points
2026-05-27T11:37:49.8733333+00:00

After creating two differente DocumentsDB instance, IP address is not registered at Azure DNS. So, no connection is possible.

User's image

User's image

Azure DocumentDB
Azure DocumentDB

A scalable, fully managed NoSQL database for JSON documents with fast queries and automatic indexing


Answer accepted by question author

AI answer

2026-05-27T11:38:12.5033333+00:00

Azure Cosmos DB for MongoDB vCore (DocumentDB) doesn’t expose a direct IP address that must be registered in Azure DNS for connectivity. Connectivity is based on DNS names and SRV records, and clients must use the mongodb+srv connection string provided in the Azure portal.

To verify and troubleshoot DNS/connection issues for the vCore cluster:

  1. Verify the private endpoint (if used)
    1. In the Azure portal, open the DocumentDB (MongoDB vCore) cluster.
    2. Go to Networking and confirm the private endpoint is listed with status Approved.
    3. Select the private endpoint and note the assigned private IP.
  2. Validate DNS resolution from within the virtual network
    • From a Windows VM in the same VNet/peered VNet:
      1. Resolve the SRV record:
                Resolve-DnsName -Name _mongodb._tcp.<your-cluster-name>.mongocluster.cosmos.azure.com -Type SRV
        
      2. Resolve each node hostname returned by the SRV record and confirm they resolve to private IPs (10.x.x.x, etc.):
                Resolve-DnsName -Name <your-node-hostname>.mongocluster.cosmos.azure.com
        
    • From Linux/macOS in the same VNet/peered VNet:
      1. Resolve the SRV record:
                dig _mongodb._tcp.<your-cluster-name>.mongocluster.cosmos.azure.com SRV
        
      2. Resolve each node hostname:
                dig <your-node-hostname>.mongocluster.cosmos.azure.com
        
  3. Fix common DNS issues
    • If DNS returns public IPs or fails:
      1. Ensure the private DNS zone privatelink.mongocluster.cosmos.azure.com exists and is linked to the VNet.
      2. Verify the DNS zone group is correctly configured on the private endpoint.
      3. Confirm the VNet DNS servers are either Azure-provided DNS (168.63.129.16) or a custom DNS that forwards to Azure DNS.
      4. Make sure tests are run from within the VNet or a properly peered VNet.
  4. Fix connection timeouts
    • Check NSG rules on the subnet to allow outbound traffic on port 27017.
    • Confirm the private endpoint NIC shows the expected private IP.
    • Ensure the client uses the exact mongodb+srv:// connection string from the portal (no modifications).
    • Verify cluster firewall rules allow access from the private endpoint or required IP ranges.
  5. If DNS still doesn’t resolve correctly
    • For custom DNS solutions, run nslookup <fqdn> for each FQDN listed in the private endpoint’s DNS configuration and confirm the returned IP matches the private IP shown in the portal. If not, update the custom DNS configuration so those names resolve to the private IP.

If these checks succeed, the cluster is correctly registered and reachable via Azure DNS, and clients should connect using the provided mongodb+srv connection string rather than a raw IP address.


References:

AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Manoj Kumar Boyini 19,590 Reputation points Microsoft External Staff Moderator
    2026-05-27T14:05:15.6733333+00:00

    Hi @Iñigo Martinez Lasala

    Thank you for confirming the resolution.

    This behavior is expected for Private Endpoint connectivity and is not related to missing public SRV registration. In this case, the private DNS zone privatelink.mongocluster.cosmos.azure.com was not present, which prevented the SRV-discovered endpoint from resolving through the private DNS path.

    When creating a Private Endpoint, Azure supports automatic DNS configuration if “Integrate with private DNS zone = Yes” is selected, otherwise equivalent DNS configuration needs to be managed manually.

    Reference:
    https://learn.microsoft.com/en-us/azure/documentdb/how-to-private-link
    https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-dns

    Hope this helps, Please let us know if you have any questions or concerns.

    Was this answer helpful?

    0 comments No comments

  2. Iñigo Martinez Lasala 20 Reputation points
    2026-05-27T11:53:36.3966667+00:00

    ; <<>> DiG 9.18.39-0ubuntu0.24.04.5-Ubuntu <<>> tdstg2mongodb03.mongocluster.cosmos.azure.com

    ;; global options: +cmd

    ;; Got answer:

    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1957

    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

    ;; QUESTION SECTION:

    ;tdstg2mongodb03.mongocluster.cosmos.azure.com. IN A

    ;; AUTHORITY SECTION:

    mongocluster.cosmos.azure.com. 300 IN SOA ns1-07.azure-dns.com. azuredns-hostmaster.microsoft.com. 1 3600 300 2419200 300

    ;; Query time: 59 msec

    ;; SERVER: 10.255.255.254#53(10.255.255.254) (UDP)

    ;; WHEN: Wed May 27 13:52:29 CEST 2026

    ;; MSG SIZE rcvd: 146

    ; <<>> DiG 9.18.39-0ubuntu0.24.04.5-Ubuntu <<>> _mongodb._tcp.tdstg2mongodb03.mongocluster.cosmos.azure.com SRV

    ;; global options: +cmd

    ;; Got answer:

    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39260

    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

    ;; OPT PSEUDOSECTION:

    ; EDNS: version: 0, flags:; udp: 1232

    ;; QUESTION SECTION:

    ;_mongodb._tcp.tdstg2mongodb03.mongocluster.cosmos.azure.com. IN SRV

    ;; ANSWER SECTION:

    _mongodb._tcp.tdstg2mongodb03.mongocluster.cosmos.azure.com. 30 IN SRV 0 0 10260 fc-a7be224f0533-000.mongocluster.cosmos.azure.com.

    ;; Query time: 100 msec

    ;; SERVER: 10.255.255.254#53(10.255.255.254) (UDP)

    ;; WHEN: Wed May 27 13:52:18 CEST 2026

    ;; MSG SIZE rcvd: 157

    No SRV register. No A register. Unable to connect.

    Instance is PUBLIC.

    Was this answer helpful?

    0 comments No comments

  3. Iñigo Martinez Lasala 20 Reputation points
    2026-05-27T11:49:13.65+00:00

    FQDN test has already been done. No IP -> hostname is registered at Azure public DNS service. No response. IP comes in blank.

    Repeated twice with two different instances. Some kind of bug is present when provisioning instances.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.