diff --git a/utils/config.h b/utils/config.h
index a87f19b53..371014580 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -21,6 +21,10 @@
 
 #include <stddef.h>
 
+#if defined(__NetBSD__)
+#include <sys/param.h>
+#endif
+
 /* Try to detect which features the target OS supports */
 
 #if (defined(_GNU_SOURCE) && \
@@ -38,7 +42,8 @@ char *strndup(const char *s, size_t n);
 #if ((defined(_GNU_SOURCE) ||			\
       defined(__APPLE__) ||			\
       defined(__HAIKU__) ||			\
-      defined(__OpenBSD__)) &&			\
+      defined(__OpenBSD__) ||			\
+      defined(__NetBSD__)) &&			\
      !defined(__serenity__))
 #define HAVE_STRCASESTR
 #else
@@ -60,7 +65,9 @@ char *strcasestr(const char *haystack, const char *needle);
 /* For some reason, UnixLib defines this unconditionally. Assume we're using
  *  UnixLib if building for RISC OS.
  */
-#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) || defined(__riscos__))
+#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) ||		\
+      defined(__riscos__) ||					\
+     (defined(__NetBSD_Version__) && __NetBSD_Prereq__(8,0,0)))
 #define HAVE_STRCHRNUL
 #else
 #undef HAVE_STRCHRNUL
