diff --git a/src/dnslib/debug.h b/src/dnslib/debug.h
index 1ea0e574abfe80e9021ee2cf35a66946013d1a51..97f6d0c5be128fb6854a973c0e0ce3cad1b3ef94 100644
--- a/src/dnslib/debug.h
+++ b/src/dnslib/debug.h
@@ -87,7 +87,18 @@ void dnslib_zone_contents_dump(dnslib_zone_contents_t *zone, char loaded_zone);
 //#define DNSLIB_ZLOAD_DEBUG
 //#define CUCKOO_DEBUG
 //#define CUCKOO_DEBUG_HASH
-#define DNSLIB_NS_DEBUG
+//#define DNSLIB_NS_DEBUG
+//#define DNSLIB_XFR_DEBUG
+
+#ifdef DNSLIB_XFR_DEBUG
+#define debug_dnslib_xfr(msg...) fprintf(stderr, msg)
+#define debug_dnslib_xfr_hex(data, len) hex_print((data), (len))
+#define DEBUG_DNSLIB_NS(cmds) do { cmds } while (0)
+#else
+#define debug_dnslib_xfr(msg...)
+#define debug_dnslib_xfr_hex(data, len)
+#define DEBUG_DNSLIB_XFR(cmds)
+#endif
 
 #ifdef DNSLIB_NS_DEBUG
 #define debug_dnslib_ns(msg...) fprintf(stderr, msg)
diff --git a/src/knot/server/xfr-in.c b/src/knot/server/xfr-in.c
index f67b354ffe013784eafdad9905f518c99589e2e7..0aebf40c623a0f5dbc26a6030328272af58399e6 100644
--- a/src/knot/server/xfr-in.c
+++ b/src/knot/server/xfr-in.c
@@ -1,4 +1,5 @@
 #include <assert.h>
+#include <urcu.h>
 
 #include "knot/server/xfr-in.h"
 //#include "knot/common.h"
@@ -6,7 +7,7 @@
 
 //#include "knot/other/error.h" /*! \todo Journal needs to be dnslib/common. */
 
-#include "knot/server/zones.h" /*! \todo Needs zonedata_t from zones.h */
+//#include "knot/server/zones.h" /*! \todo Needs zonedata_t from zones.h */
 
 #include "common/evsched.h"
 
@@ -78,8 +79,8 @@ static int xfrin_create_query(const dnslib_zone_contents_t *zone, uint16_t qtype
 	}
 
 	if (wire_size > *size) {
-		log_answer_warning("Not enough space provided for the wire "
-		                   "format of the query.\n");
+		debug_dnslib_xfr("Not enough space provided for the wire "
+		                 "format of the query.\n");
 		dnslib_packet_free(&pkt);
 		return DNSLIB_ESPACE;
 	}
@@ -202,7 +203,7 @@ int xfrin_transfer_needed(const dnslib_zone_contents_t *zone,
 	if (soa_rrset == NULL) {
 		char *name = dnslib_dname_to_str(dnslib_node_owner(
 				dnslib_zone_contents_apex(zone)));
-		log_answer_warning("SOA RRSet missing in the zone %s!\n", name);
+		debug_dnslib_xfr("SOA RRSet missing in the zone %s!\n", name);
 		free(name);
 		return DNSLIB_ERROR;
 	}
@@ -211,7 +212,7 @@ int xfrin_transfer_needed(const dnslib_zone_contents_t *zone,
 		dnslib_rrset_rdata(soa_rrset));
 	if (local_serial < 0) {
 		char *name = dnslib_dname_to_str(dnslib_rrset_owner(soa_rrset));
-		log_answer_warning("Malformed data in SOA of zone %s\n", name);
+		debug_dnslib_xfr("Malformed data in SOA of zone %s\n", name);
 		free(name);
 		return DNSLIB_EMALF;	// maybe some other error
 	}