Index: proxy_http.c
===================================================================
--- proxy_http.c	(revision 164610)
+++ proxy_http.c	(working copy)
@@ -189,9 +189,14 @@
 
     /* do a DNS lookup for the destination host */
     /* see memory note above */
-    err = apr_sockaddr_info_get(&uri_addr, apr_pstrdup(c->pool, uri->hostname),
-                                APR_UNSPEC, uri->port, 0, c->pool);
-
+    if ( !proxyname || (conf->noproxies->nelts > 0) ) {
+         err = apr_sockaddr_info_get(&uri_addr, apr_pstrdup(c->pool, uri->hostname),
+                                    APR_UNSPEC, uri->port, 0, c->pool);
+         if (err != APR_SUCCESS) 
+             return ap_proxyerror(r, HTTP_BAD_GATEWAY,
+                                  apr_pstrcat(p, "DNS lookup failure for: ",
+                                  uri->hostname, NULL));
+    }
     /* allocate these out of the connection pool - the check on
      * r->connection->id makes sure that this string does not get accessed
      * past the connection lifetime */

