diff --git a/lib/hostip.c b/lib/hostip.c
index 791ee030c7cff8a15fff5dc288f76dfe1fae26cf..9d0013ffe76b19b8f3d062aea35e6603b3b636aa 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -89,6 +89,7 @@ void Curl_global_host_cache_dtor(void)
 {
   if (host_cache_initialized) {
     curl_hash_clean(&hostname_cache);
+    host_cache_initialized = 0;
   }
 }