diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index cc49a2af80bf8094671517e6152cab0bd02cb23a..0f76ff23ea9731b14eaed7001646da45a9b17991 100644
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -555,6 +555,11 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
 	// about 700 or so requests and starts issuing TCP RSTs to
 	// new connections.  Reuse the DNS lookups for even a few
 	// seconds and no RSTs.
+	//
+	// -1 stores forever
+	// 0  never stores
+	// any other positive number specifies seconds
+	// supposedly curl 7.62.0 can use TTL by default, otherwise default is 60 seconds
 	check_curl_easy_setopt(mCurlHandle, CURLOPT_DNS_CACHE_TIMEOUT, dnsCacheTimeout);
 
 	if (gpolicy.mUseLLProxy)
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index bc93fa2c20f0e5592727b1b72eb25570892b6107..bf4fc029eec7e7e5705912a72ae6ce51a1914a58 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -63,6 +63,9 @@
 #include <sstream>
 
 const S32 LOGIN_MAX_RETRIES = 3;
+const F32 LOGIN_SRV_TIMEOUT_MIN = 10;
+const F32 LOGIN_SRV_TIMEOUT_MAX = 120;
+const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9; // make DNS wait shorter then retry time
 
 class LLLoginInstance::Disposable {
 public:
@@ -232,8 +235,10 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
 
 	// Specify desired timeout/retry options
 	LLSD http_params;
-	http_params["timeout"] = gSavedSettings.getF32("LoginSRVTimeout");
+	F32 srv_timeout = llclamp(gSavedSettings.getF32("LoginSRVTimeout"), LOGIN_SRV_TIMEOUT_MIN, LOGIN_SRV_TIMEOUT_MAX);
+	http_params["timeout"] = srv_timeout;
 	http_params["retries"] = LOGIN_MAX_RETRIES;
+	http_params["DNSCacheTimeout"] = srv_timeout * LOGIN_DNS_TIMEOUT_FACTOR; //Default: indefinite
 
 	mRequestData.clear();
 	mRequestData["method"] = "login_to_simulator";
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index cc223c1f4890468b44e301b7d90480208886e4f0..8e2539606bf8b1c76bbef88cf297c48959dc404b 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -362,6 +362,10 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip, const
 	{
 		httpOpts->setRetries(httpParams["retries"].asInteger());
 	}
+	if (httpParams.has("DNSCacheTimeout"))
+	{
+		httpOpts->setDNSCacheTimeout(httpParams["DNSCacheTimeout"].asInteger());
+	}
 
 	bool vefifySSLCert = !gSavedSettings.getBOOL("NoVerifySSLCert");
 	mCertStore = gSavedSettings.getString("CertStore");