This is strange. You are right, the host might not have DNS entry but I can somehow connect to it from my local machine (which I cant explain why). Also, let me reiterate that I've had similar script on Tommy connecting to the same mongodb database before and it was working fine. Initially it didn't work but after I requested for port 27017 to be opened, it started working.
I tried to test whether port 27017 is open on Tommy using the script here (source attached), it doesn't seem like the port is open though. When I tried with port 80, 443 and 3306, it did respond saying the ports were open.. would appreciate if you could verify that port 27017 is indeed open for the three IPs requested above?
This is the expected response when the test-port script was run on my machine..
Thanks in advance.
test-port.py