My internet connection has an issue. Around 50% of times, web pages don't load because of DNS look up failing. Just reloading page works, and I am able to browse like that.
However, I am also using REST api service for my project. When I run the program, it keeps on calling this webservice repeatedly, hundreds of times. Because of my issue, I can at most connect successfully 3-4 times (when I am lucky), and then ultimately I get connection error - "Max number of retries exceeded". 
I was exploring my options when I came across this Keep Alive property in Requests module. Its automatic, and I cant forcefully make it work. 
How do I get this working?
P.S. - I know fixing my internet connection issue will solve it, but I am moving in a week, so I dont want to waste time here. Also need to complete my project, so please helppppp!!
You could try setting up your application or operating system to use a known good DNS server like 8.8.8.8
EDIT: You can also bypass the DNS by adding the host name and IP address of the REST service to yor hosts file.
Using Keep Alive in Requests module - Python 2.7