title: ServerSelectionTimeoutError errno 11001 getaddrinfo failed python
body: <pre><code>mongodb_uri = "mongodb://[username:password@]XX.XX.XX.XX"
  
  client = MongoClient(mongodb_uri)
  db = client['database']
  print(db)
  
  collection_taxonomy = db['collection']
  
  doc = collection_taxonomy.find()
  pprint.pprint(doc)
  for each_doc in doc:
      pprint.pprint(each_doc)  
  </code></pre>
  
  <p>I am getting <code>time out error</code> as I try to print each document of the collection. However, I do not get time out error when I try to connect to <code>localhost</code>.</p>
  
  <p>Tried connecting with <code>connect=False
  client = MongoClient(mongodb_uri,connect=False)</code></p>
  
  <p>Still I get time out error while i print each document.
  What could be wrong? Appreciate if someone can help me .
  I am using Python 3.5 and Pymongo 3.5.1
  Thanks,
  -Roopa</p>