diff --git a/gio/gnetworkingprivate.h b/gio/gnetworkingprivate.h
index 8af75aa..9df2e88 100644
--- a/gio/gnetworkingprivate.h
+++ b/gio/gnetworkingprivate.h
@@ -33,10 +33,26 @@
 
 #include <arpa/inet.h>
 #include <arpa/nameser.h>
-#if HAVE_ARPA_NAMESER_COMPAT_H
-#include <arpa/nameser_compat.h>
+
+#ifndef T_SRV
+#define T_SRV  33
 #endif
 
+/* Some systems don't those namespaced constants defined, see 
+ * http://bugzilla.gnome.org/show_bug.cgi?id=162289
+ * I'm assuming that if 1 constant isn't defined, then all the others
+ * are missing too, please file a bug if that's not the case on your system
+ */
+#ifndef NS_MAXDNAME
+#define NS_MAXDNAME MAXDNAME
+#define NS_HFIXEDSZ HFIXEDSZ
+#define ns_c_in     C_IN
+#define ns_t_any    T_ANY
+#define ns_t_srv    T_SRV
+#define ns_t_txt    T_TXT
+#define ns_t_ptr    T_PTR
+#endif /* NS_MAXDNAME */
+
 /* We're supposed to define _GNU_SOURCE to get EAI_NODATA, but that
  * won't actually work since <features.h> has already been included at
  * this point. So we define __USE_GNU instead.
diff --git a/gio/gunixresolver.c b/gio/gunixresolver.c
index 36bb046..fd4bc02 100644
--- a/gio/gunixresolver.c
+++ b/gio/gunixresolver.c
@@ -24,6 +24,8 @@
 #include <glib.h>
 #include "glibintl.h"
 
+#include <netinet/in.h>
+#include <arpa/nameser.h>
 #include <resolv.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/gio/libasyncns/asyncns.c b/gio/libasyncns/asyncns.c
index 3c4db73..b88849d 100644
--- a/gio/libasyncns/asyncns.c
+++ b/gio/libasyncns/asyncns.c
@@ -40,10 +40,9 @@
 #include <arpa/nameser.h>
 #include <resolv.h>
 #include <dirent.h>
-
-#if HAVE_ARPA_NAMESER_COMPAT_H
-#include <arpa/nameser_compat.h>
-#endif
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <stdint.h>
 
 #ifdef HAVE_SYS_PRCTL_H
 #include <sys/prctl.h>
