Hi,
I am having trouble connecting to my MongoDB database from my hosting server at Heliohost.org. The server is running python 3.10.8 and all required dependencies have been installed. Port 27017 have also been opened for the primary and two secondary domain IPs i.e.
- radtech-shard-00-01.p4cyn.mongodb.net ( 18.138.205.196 )
- radtech-shard-00-00.p4cyn.mongodb.net ( 54.255.46.254 )
- radtech-shard-00-02.p4cyn.mongodb.net ( 52.74.75.34 )
My script managed to connect to the database from my local machine without problem but it failed to connect from the hosting server. My connection string used is:
mongodb+srv://user:password@radtech.p4cyn.mongodb.net/mydatabase?retryWrites=true&w=majority
I tried to get help from the server admins and the following are some of the feedbacks i got from them:
- The script you listed is trying to connect to radtech.p4cyn.mongodb.net which doesn’t exist, or at least there is no DNS for it…
- You can’t connect to a website that doesn’t return an A record. Either connect to it directly by IP address, ie: 18.138.205.196:27017, or come up with a new URL that actually exists…
- It doesn’t resolve for me either against any DNS server I’ve tried… A normal lookup (A) returns no value, and doing an ALL lookup returned a single TXT record… You need to either: Use an IP address directly, use a URL whose DNS zone actually has an A record in it, or contact the database host and ask them to fix their DNS zone…
- What we don’t understand is how this is working for you without an A record present, unless it’s doing something weird like only responding for requests in a certain part of the world (we are both in the USA, as is our server), or perhaps it’s using a SRV record instead?..
- You can use this tool https://dnschecker.org/#A/radtech.p4cyn.mongodb.net to check A records from 33 DNS servers all around the world. They all report that there is no A record for that domain…
Sorry as i’m pasting here the comments verbatim because i’m not that good at re-explaining this myself… i’m not really familiar with everything about DNS records, so could someone explain what is all this about? Why am i not able to connect to the database from my hosting server? what can/should my hosting server do to allow me to connect to MongoDB host ?
Thanks in advance…