Can't connect to free tier mongo cluster

Michael Katsoulakis 0 Reputation points
2024-12-08T20:00:41.4566667+00:00

I am trying to connect to my Free Tier mongo cluster.
Through MongoDB Compass I get this error: Server record does not share hostname with parent URI.
It seems like a DNS issue, anyone else who has encountered the same issue?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,786 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Michael Katsoulakis 0 Reputation points
    2024-12-09T09:42:05.66+00:00

    UPDATE: It was a DNS issue. After changing to Google's DNS it seems to have resolved the issue.

    0 comments No comments

  2. ShaktiSingh-MSFT 16,251 Reputation points
    2024-12-09T12:50:17.7233333+00:00

    Hi Michael Katsoulakis •,

    Welcome to Microsoft Q&A forum.

    As I understand, you could not connect to free tier mongo cluster of Azure Cosmos DB.

    To check connectivity, follow these steps:

    nc -v <accountName>.mongocluster.cosmos.azure.com 10260

    If TCP connect to port 10260 fails, an environment firewall may be blocking the Azure Cosmos DB connection. Kindly raise support case if this fails.

    https://azure.microsoft.com/support/create-ticket/

    OR

    If your password includes special characters, and you are using your password in a connection string URI, encode the special characters.

    Refer: https://www.mongodb.com/docs/atlas/troubleshoot-connection/#special-characters-in-connection-string-password

    Let us know if this helps.

    Thanks

    0 comments No comments

  3. ShaktiSingh-MSFT 16,251 Reputation points
    2024-12-10T03:31:10.78+00:00

    Hi Michael Katsoulakis •,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Solution: It was a DNS issue. After changing to Google's DNS it seems to have resolved the issue.

    If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    Thanks

    0 comments No comments

  4. peoplelab 0 Reputation points
    2025-03-12T12:00:32.4033333+00:00

    i am strggling with the same error a bit of context .

    mongo driver 7.0

    mongoose ^8

    consmosdb for mongo free tier

    using the connection string provided in resource :

    mongodb+srv://<userAdmin>:<password>@cluster3.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000"

    and the error is always

    MongoAPIError: Server record does not share hostname with parent URI

    if i run:

    nc -v cluster3.mongocluster.cosmos.azure.com 10260
    nc: getaddrinfo: nodename nor servname provided, or not known
    MacBook-Pro-de-Francisco:~ franciscocodino$ 
    
    
    

    but:

    nc -v c.cluster3.mongocluster.cosmos.azure.com 10260
    Connection to c.cluster3.mongocluster.cosmos.azure.com port 10260 [tcp/axis-wimp-port] succeeded!
    

    dont understand were that extra c is coming from and how it reache to connect.

    but either updating the connection string or removing +srv nor changing my local DNS resolver to google's (8.8.8.8) resolve the issue.

    i removed local machine firewall, and allowed all IP ranges to connect to my DB adnd nothing.

    Pllease HElP

    0 comments No comments

Your answer

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