How can i find the IP and Port of my Database hosted in Mongo Atlas?
Regarding the ports, you may find the Troubleshoot Connection Issues documentation useful, more specifically the following:
Atlas clusters operate on port 27017 . You must be able to reach this port to connect to your clusters. Additionally, ensure that the appropriate ports are open for the following:
- For sharded clusters, grant access to port 27016.
- For BI Connector, grant access to port 27015.
In regards to finding the IP for each of the nodes in your Atlas cluster, you can perform a simple ping hostname. To find the hostnames of each node within your cluster, you can click the metrics button on the cluster as shown in the below example:

After clicking the metrics button, the hostname:port should be in a similar format to the below example:
(Where cluster0-shard-00-00.abcde.mongodb.net is the hostname)
They answered that they want to know the IP and Port of external MongoDB server in order to whitelist outgoing firewall exceptions at their firewall.
I must note that there are cases where the public IP’s can change. For this reason, it may be better that they whitelist the hostname rather than the IP address.
Hope this helps.
Kind Regards,
Jason