auto import from //branches/cupcake/...@132276
diff --git a/libc/netbsd/resolv/res_state.c b/libc/netbsd/resolv/res_state.c
index 8f2851a..3a2301d 100644
--- a/libc/netbsd/resolv/res_state.c
+++ b/libc/netbsd/resolv/res_state.c
@@ -46,7 +46,6 @@
     struct __res_state     _nres[1];
     unsigned               _serial;
     struct prop_info*      _pi;
-    struct hostent*        _hostent;
     struct res_static      _rstatic[1];
 } _res_thread;
 
@@ -66,9 +65,9 @@
         if ( res_ninit( rt->_nres ) < 0 ) {
             free(rt);
             rt = NULL;
+        } else {
+            memset(rt->_rstatic, 0, sizeof rt->_rstatic);
         }
-        rt->_hostent = NULL;
-        memset(rt->_rstatic, 0, sizeof rt->_rstatic);
     }
     return rt;
 }
@@ -93,7 +92,6 @@
     _res_thread*  rt = _rt;
 
     _res_static_done(rt->_rstatic);
-    _resolv_hostent_free(rt->_hostent);
     res_ndestroy(rt->_nres);
     free(rt);
 }
@@ -132,6 +130,7 @@
         rt = NULL;
         pthread_setspecific( _res_key, rt );
     }
+    _resolv_cache_reset(rt->_serial);
     return rt;
 }
 
@@ -177,14 +176,6 @@
     res=res;
 }
 
-struct hostent**
-__get_res_cache_hostent_p(void)
-{
-    _res_thread*  rt = _res_thread_get();
-
-    return rt ? &rt->_hostent : NULL;
-}
-
 res_static
 __res_get_static(void)
 {