UPDATE: It was a DNS issue. After changing to Google's DNS it seems to have resolved the issue.
Can't connect to free tier mongo cluster
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?
4 answers
Sort by: Most helpful
-
-
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.
Let us know if this helps.
Thanks
-
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
-
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