# MongoDB - Resolving \[500\] System error: No such host is known

**URL:** <https://community.cdata.com/t/mongodb-resolving-500-system-error-no-such-host-is-known/895>\
**Category:** Data Sources\
**Tags:** atlas, shard, article, cloud, mongodb\
**Created:** [September 3, 2024, 7:06pm UTC](https://community.cdata.com/t/mongodb-resolving-500-system-error-no-such-host-is-known/895 "2024-09-03T19:06:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ockert](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@Ockert](https://community.cdata.com/u/Ockert)\
**Post date:** [September 3, 2024, 7:06pm UTC](https://community.cdata.com/t/mongodb-resolving-500-system-error-no-such-host-is-known/895/1 "2024-09-03T19:06:48Z")

</div>

The “No such host is known” error appears when an invalid value is used for the [_Server_](https://cdn.cdata.com/help/DGK/odbc/RSBMongodb_p_Server.htm) connection property.

The first step is ensuring the host name or IP address is valid. [MongoDB Compass](https://www.mongodb.com/products/tools/) is a great tool for running connection tests.

For MongoDB Atlas users, this error often occurs when the shard value is excluded.

On Atlas, the server property should look like this: _[cluster0-shard-00-00-test.mongodb.net](http://cluster0-shard-00-00-test.mongodb.net)_

**To find your shard value:**

1. Login to the [Atlas Portal](https://account.mongodb.com/account/login).

2. Click on a project name.

![6b4d5358-3f98-4680-9490-b2a982d0c925.png](https://us1.discourse-cdn.com/cdata/original/1X/1970bf84f9bb81ec913e32434a997df20e793b34.png)

3. On the left-hand pane, click on _Database._

 ![a37acd67-39e1-47d7-8f9e-a8e435b16458.png](https://us1.discourse-cdn.com/cdata/original/2X/3/354b2d979076d3c62922cc6c2b0c8250919cddb9.png)

4. Click on the cluster you wish to use (Cluster0 for example).

![4d00036c-8cf7-43df-9107-8e0688dec635.png](https://us1.discourse-cdn.com/cdata/original/1X/73066061ef57f8d975e81a1002fb5c4b3afb5b8b.png)

5. You should now see a list of shards under the _Region_ section. Hover over the shards to reveal the full value (the format is: _[cluster0-shard-00-00-test.mongodb.net](http://cluster0-shard-00-00-test.mongodb.net)_):

 ![d736e827-773c-4a69-aa83-ccccb189b0ae.png](https://us1.discourse-cdn.com/cdata/original/1X/68cb922dd4b7ebc22bcc9aaabf7c1cf2db6a0f57.png)

It is recommended to use the primary shard for the server property. The secondary shards can be applied under the [_ReplicaSet_](https://cdn.cdata.com/help/DGK/odbc/RSBMongodb_p_ReplicaSet.htm) property.

Do not include the port value (usually 27017) in the Server property. This should instead be set under the [_Port_](https://cdn.cdata.com/help/DGK/odbc/RSBMongodb_p_Port.htm) connection property.

**You can read more about shard values here** : [MongoDB Sharding](https://www.mongodb.com/resources/products/capabilities/sharding)

**Atlas connection documentation can be found here** : [DBaas Connections](https://cdn.cdata.com/help/DGK/odbc/pg_mongodbaas.htm)

**Full driver documentation can be found here** : [MongoDB Docs](https://www.cdata.com/drivers/mongodb/docs/)

For any additional questions, please contact [support@cdata.com](mailto:support@cdata.com)
