diff --git a/examples/nanocoap_server/main.c b/examples/nanocoap_server/main.c
index 91ce26ef9a51676181133550991da7f875e2aef6..dca6322c0c64f3f0653edd730b824472c9314ec2 100644
--- a/examples/nanocoap_server/main.c
+++ b/examples/nanocoap_server/main.c
@@ -19,9 +19,7 @@
 
 #include <stdio.h>
 
-#include "net/nanocoap.h"
 #include "net/nanocoap_sock.h"
-
 #include "xtimer.h"
 
 #define COAP_INBUF_SIZE (256U)
diff --git a/sys/include/net/nanocoap_sock.h b/sys/include/net/nanocoap_sock.h
index fd983212cabcbd4a14ee494f71278822ee056926..97a2e290ce4344db283b4f2e3353d0341e212f9e 100644
--- a/sys/include/net/nanocoap_sock.h
+++ b/sys/include/net/nanocoap_sock.h
@@ -23,6 +23,7 @@
 #include <stdint.h>
 #include <unistd.h>
 
+#include "net/nanocoap.h"
 #include "net/sock/udp.h"
 
 #ifdef __cplusplus
diff --git a/sys/net/application_layer/nanocoap/sock.c b/sys/net/application_layer/nanocoap/sock.c
index ad8118b5464a91195e20e8e93a53d6d5b197e8b4..ef2e0d6939c75975ca099a64d6acbede9708e1b6 100644
--- a/sys/net/application_layer/nanocoap/sock.c
+++ b/sys/net/application_layer/nanocoap/sock.c
@@ -22,7 +22,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "net/nanocoap.h"
+#include "net/nanocoap_sock.h"
 #include "net/sock/udp.h"
 
 #define ENABLE_DEBUG (0)