--- a/configure.in
+++ b/configure.in
@@ -1018,6 +1018,10 @@ if test $glib_native_win32 = no; then
       ] )
     ]
   )
+  EXPLICIT_LIBRESOLV=
+  AC_CHECK_LIB(resolv, res_9_query, EXPLICIT_LIBRESOLV="-lresolv")
+  AC_CHECK_LIB(resolv, res_9_query, [ LIBASYNCNS_LIBADD="-lresolv" ], ) 
+  AC_SUBST(EXPLICIT_LIBRESOLV)
   AC_SUBST(LIBASYNCNS_LIBADD)
 fi
 
diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
index baefef1..c3e104c 100644
--- a/gio-2.0.pc.in
+++ b/gio-2.0.pc.in
@@ -9,5 +9,5 @@ Name: GIO
 Description: glib I/O library
 Version: @VERSION@
 Requires: glib-2.0,gobject-2.0,gmodule-no-export-2.0
-Libs: -L${libdir} -lgio-2.0
+Libs: -L${libdir} -lgio-2.0 @EXPLICIT_LIBRESOLV@
 Cflags: 
