Index: dll/win32/dnsapi/dnsapi/query.c
===================================================================
--- dll/win32/dnsapi/dnsapi/query.c	(revision 72896)
+++ dll/win32/dnsapi/dnsapi/query.c	(working copy)
@@ -771,6 +771,12 @@
         }
 
         adns_error = adns_init(&astate, adns_if_noenv | adns_if_noerrprint | adns_if_noserverwarn, 0);
+        if (adns_error != adns_s_ok)
+        {
+            RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiName);
+            RtlFreeHeap(RtlGetProcessHeap(), 0, network_info);
+            return DnsIntTranslateAdnsToDNS_STATUS(adns_error);
+        }
         for (pip = &(network_info->DnsServerList); pip; pip = pip->Next)
         {
             addr.s_addr = inet_addr(pip->IpAddress.String);
@@ -783,12 +789,6 @@
         }
         RtlFreeHeap(RtlGetProcessHeap(), 0, network_info);
 
-        if (adns_error != adns_s_ok)
-        {
-            RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiName);
-            return DnsIntTranslateAdnsToDNS_STATUS(adns_error);
-        }
-
         if (Servers)
         {
             for (i = 0; i < Servers->AddrCount; i++)
@@ -829,7 +829,7 @@
                 return DnsIntTranslateAdnsToDNS_STATUS(adns_error);
             }
 
-            if (answer && answer->rrs.addr)
+            if (answer && answer->nrrs > 0 && answer->rrs.addr)
             {
                 if (CurrentName != AnsiName)
                     RtlFreeHeap(RtlGetProcessHeap(), 0, CurrentName);
@@ -855,7 +855,7 @@
                 return (*QueryResultSet)->pName ? ERROR_SUCCESS : ERROR_OUTOFMEMORY;
             }
 
-            if (NULL == answer || adns_s_prohibitedcname != answer->status || NULL == answer->cname)
+            if (NULL == answer || adns_s_prohibitedcname != answer->status || 0 == answer->nrrs || NULL == answer->cname)
             {
                 adns_finish(astate);
 
Index: sdk/lib/3rdparty/adns/src/setup.c
===================================================================
--- sdk/lib/3rdparty/adns/src/setup.c	(revision 72896)
+++ sdk/lib/3rdparty/adns/src/setup.c	(working copy)
@@ -521,10 +521,11 @@
 }
 
 static int init_finish(adns_state ads) {
-  struct in_addr ia;
   struct protoent *proto;
   int r;
-
+/* Don't add loopback on ReactOS it slows down queries to non existent server */
+#ifndef __REACTOS__
+  struct in_addr ia;
   if (!ads->nservers) {
     if (ads->diagfile && ads->iflags & adns_if_debug)
       fprintf(ads->diagfile,"adns: no nameservers, using localhost\n");
@@ -531,7 +532,7 @@
     ia.s_addr= htonl(INADDR_LOOPBACK);
     addserver(ads,ia);
   }
-
+#endif
   proto= getprotobyname("udp"); if (!proto) { r= ENOPROTOOPT; goto x_free; }
   ADNS_CLEAR_ERRNO;
   ads->udpsocket= socket(AF_INET,SOCK_DGRAM,proto->p_proto);
