--- a/common/resolver.cpp
+++ b/common/resolver.cpp
@@ -15,10 +15,14 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#ifdef __ANDROID__
+#include <sys/endian.h>
+#endif
+
 #include "common/kprintf.h"
 #include "common/options.h"
 
-#define	HOSTS_FILE	"/etc/hosts"
+#define	HOSTS_FILE	"@TERMUX_PREFIX@/etc/hosts"
 #define	MAX_HOSTS_SIZE	(1L << 24)
 
 int kdb_hosts_loaded;
