diff --git a/src/contrib/sockaddr.c b/src/contrib/sockaddr.c
index fe36228023bde90753d7a35cadf26ab25805cefc..c10dbfc225571909ada83ffbd026b16919b1e4da 100644
--- a/src/contrib/sockaddr.c
+++ b/src/contrib/sockaddr.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@
 #include <string.h>
 #include <netdb.h>
 
-#include "libknot/consts.h"
 #include "libknot/errcode.h"
 #include "contrib/sockaddr.h"
 #include "contrib/openbsd/strlcpy.h"
@@ -249,7 +248,7 @@ void sockaddr_port_set(struct sockaddr *sa, uint16_t port)
 char *sockaddr_hostname(void)
 {
 	/* Fetch hostname. */
-	char host[KNOT_DNAME_MAXLEN + 1] = { '\0' };
+	char host[256] = "";
 	if (gethostname(host, sizeof(host)) != 0) {
 		return NULL;
 	}
diff --git a/src/knot/common/log.c b/src/knot/common/log.c
index 3024256d48fbc650ddd3a56f5d44d5c577cf247b..e7411eecec2c26655ac8e15ac17029d35db0440d 100644
--- a/src/knot/common/log.c
+++ b/src/knot/common/log.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -349,7 +349,7 @@ void log_fmt(int priority, log_source_t src, const char *fmt, ...)
 void log_fmt_zone(int priority, log_source_t src, const knot_dname_t *zone,
                   const char *param, const char *fmt, ...)
 {
-	char buff[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t buff;
 	char *zone_str = knot_dname_to_str(buff, zone, sizeof(buff));
 	if (zone_str == NULL) {
 		zone_str = NULL_ZONE_STR;
diff --git a/src/knot/common/stats.c b/src/knot/common/stats.c
index 918e0b60a6c865fda8b14a4fd630d24b12cee2c5..a597c2f474cc99f843985354f44af9519cec27d6 100644
--- a/src/knot/common/stats.c
+++ b/src/knot/common/stats.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -97,7 +97,7 @@ static void dump_modules(dump_ctx_t *ctx)
 			}
 			level = 1;
 
-			char name[KNOT_DNAME_TXT_MAXLEN + 1];
+			knot_dname_txt_storage_t name;
 			if (knot_dname_to_str(name, ctx->zone, sizeof(name)) == NULL) {
 				return;
 			}
diff --git a/src/knot/ctl/commands.c b/src/knot/ctl/commands.c
index d7290d2943197ae1d252fbf5617bb8a1980916dd..9c64f1964ecc7d0a3a7317a1794e4b8159d56a90 100644
--- a/src/knot/ctl/commands.c
+++ b/src/knot/ctl/commands.c
@@ -159,7 +159,7 @@ static int zones_apply(ctl_args_t *args, int (*fcn)(zone_t *, ctl_args_t *))
 
 static int zone_status(zone_t *zone, ctl_args_t *args)
 {
-	char name[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t name;
 	if (knot_dname_to_str(name, zone->name, sizeof(name)) == NULL) {
 		return KNOT_EINVAL;
 	}
@@ -517,8 +517,8 @@ typedef struct {
 	int type_filter; // -1: no specific type, [0, 2^16]: specific type.
 	knot_dump_style_t style;
 	knot_ctl_data_t data;
-	char zone[KNOT_DNAME_TXT_MAXLEN + 1];
-	char owner[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t zone;
+	knot_dname_txt_storage_t owner;
 	char ttl[16];
 	char type[32];
 	char rdata[2 * 65536];
@@ -874,7 +874,7 @@ static int get_ttl(zone_t *zone, ctl_args_t *args, uint32_t *ttl)
 static int create_rrset(knot_rrset_t **rrset, zone_t *zone, ctl_args_t *args,
                         bool need_ttl)
 {
-	char origin_buff[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t origin_buff;
 	char *origin = knot_dname_to_str(origin_buff, zone->name, sizeof(origin_buff));
 	if (origin == NULL) {
 		return KNOT_EINVAL;
@@ -1239,7 +1239,7 @@ static int modules_stats(list_t *query_modules, ctl_args_t *args, knot_dname_t *
 	const char *section = args->data[KNOT_CTL_IDX_SECTION];
 	const char *item = args->data[KNOT_CTL_IDX_ITEM];
 
-	char name[KNOT_DNAME_TXT_MAXLEN + 1] = { 0 };
+	knot_dname_txt_storage_t name = "";
 	knot_ctl_data_t data = { 0 };
 
 	bool section_found = (section == NULL) ? true : false;
@@ -1575,7 +1575,7 @@ static int send_block(conf_io_t *io)
 	default: break;
 	}
 
-	char id[KNOT_DNAME_TXT_MAXLEN + 1] = "\0";
+	knot_dname_txt_storage_t id;
 
 	// Get the textual item id.
 	if (io->id_len > 0 && io->key0 != NULL) {
diff --git a/src/knot/modules/synthrecord/synthrecord.c b/src/knot/modules/synthrecord/synthrecord.c
index 6ed5ec775f8f1ad3d2ae2cfaabba5604c7976fb3..a55b1cb878ad0f6c7794e6fcfda634b0fd10a5f7 100644
--- a/src/knot/modules/synthrecord/synthrecord.c
+++ b/src/knot/modules/synthrecord/synthrecord.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -254,7 +254,7 @@ static int addr_parse(knotd_qdata_t *qdata, const synth_template_t *tpl, char *a
 static knot_dname_t *synth_ptrname(uint8_t *out, const char *addr_str,
                                    const synth_template_t *tpl, int addr_family)
 {
-	char ptrname[KNOT_DNAME_TXT_MAXLEN];
+	knot_dname_txt_storage_t ptrname;
 	int addr_len = strlen(addr_str);
 	const char sep = str_separator(addr_family);
 
diff --git a/src/knot/updates/zone-update.c b/src/knot/updates/zone-update.c
index c3b9d312335de4e11de78c66fd034ef804101d03..6f69267b42ebeb11772716b02fca70077921989b 100644
--- a/src/knot/updates/zone-update.c
+++ b/src/knot/updates/zone-update.c
@@ -395,7 +395,7 @@ static int solve_add_different_ttl(zone_update_t *update, const knot_rrset_t *ad
 		return KNOT_EOK;
 	}
 
-	char buff[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t buff;
 	char *owner = knot_dname_to_str(buff, add->owner, sizeof(buff));
 	if (owner == NULL) {
 		owner = "";
@@ -466,7 +466,7 @@ int zone_update_add(zone_update_t *update, const knot_rrset_t *rrset)
 		zone_node_t *n = NULL;
 		int ret = zone_contents_add_rr(update->new_cont, rrset, &n);
 		if (ret == KNOT_ETTL) {
-			char buff[KNOT_DNAME_TXT_MAXLEN + 1];
+			knot_dname_txt_storage_t buff;
 			char *owner = knot_dname_to_str(buff, rrset->owner, sizeof(buff));
 			if (owner == NULL) {
 				owner = "";
diff --git a/src/knot/zone/semantic-check.c b/src/knot/zone/semantic-check.c
index f163c61af6e5861b5f1cb261798b8d8fc720ca83..cd800c5f98a0e7ac71ce3e9bd868c4cc18c93df0 100644
--- a/src/knot/zone/semantic-check.c
+++ b/src/knot/zone/semantic-check.c
@@ -727,7 +727,7 @@ static void bitmap_add_all_node_rrsets(dnssec_nsec_bitmap_t *bitmap,
 
 static char *nsec3_info(const knot_dname_t *owner, char *out, size_t out_len)
 {
-	char buff[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t buff;
 	char *str = knot_dname_to_str(buff, owner, sizeof(buff));
 	if (str == NULL) {
 		return NULL;
diff --git a/src/knot/zone/zonefile.c b/src/knot/zone/zonefile.c
index 02d23b87112a49fd80de83880e7833a7fceabc17..d781e2605f9828c2a1ccc1e1cb9d4d837754b8f6 100644
--- a/src/knot/zone/zonefile.c
+++ b/src/knot/zone/zonefile.c
@@ -54,7 +54,7 @@ static bool handle_err(zcreator_t *zc, const knot_rrset_t *rr, int ret, bool mas
 {
 	const knot_dname_t *zname = zc->z->apex->owner;
 
-	char buff[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t buff;
 	char *owner = knot_dname_to_str(buff, rr->owner, sizeof(buff));
 	if (owner == NULL) {
 		owner = "";
@@ -337,16 +337,18 @@ void err_handler_logger(sem_handler_t *handler, const zone_contents_t *zone,
 		handler->warning = true;
 	}
 
-	char buff[KNOT_DNAME_TXT_MAXLEN + 1] = "";
+	knot_dname_txt_storage_t owner;
 	if (node != NULL) {
-		(void)knot_dname_to_str(buff, node->owner, sizeof(buff));
+		if (knot_dname_to_str(owner, node->owner, sizeof(owner)) == NULL) {
+			owner[0] = '\0';
+		}
 	}
 
 	log_fmt_zone(handler->fatal_error ? LOG_ERR : LOG_WARNING,
 	             LOG_SOURCE_ZONE, zone->apex->owner, NULL,
 	             "check%s%s, %s%s%s",
 	             (node != NULL ? ", node " : ""),
-	             (node != NULL ? buff      : ""),
+	             (node != NULL ? owner     : ""),
 	             sem_error_msg(error),
 	             (data != NULL ? " "  : ""),
 	             (data != NULL ? data : ""));
diff --git a/src/libknot/dname.h b/src/libknot/dname.h
index c68f880a4049f07e4d32295babd0b8d5dc731384..12ad9f35b2f569ef7359571a205c2595763d301a 100644
--- a/src/libknot/dname.h
+++ b/src/libknot/dname.h
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -38,6 +38,9 @@ typedef uint8_t knot_dname_t;
 /*! \brief Local domain name storage. */
 typedef uint8_t knot_dname_storage_t[KNOT_DNAME_MAXLEN];
 
+/*! \brief Local textual domain name storage. */
+typedef char knot_dname_txt_storage_t[KNOT_DNAME_TXT_MAXLEN + 1];
+
 /*!
  * \brief Check dname on the wire for constraints.
  *
diff --git a/src/libknot/yparser/yptrafo.c b/src/libknot/yparser/yptrafo.c
index 24338a899788cc22cb28d5c6e7534b8fb5cf09cd..f49f48369fa64e5ccc87bd2595a3b566c39bd266 100644
--- a/src/libknot/yparser/yptrafo.c
+++ b/src/libknot/yparser/yptrafo.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -681,7 +681,7 @@ int yp_dname_to_bin(
 	YP_CHECK_PARAMS_BIN;
 
 	// Copy dname string to the buffer to limit dname_from_str overread.
-	char buf[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t buf;
 	wire_ctx_t buf_ctx = copy_in(in, YP_LEN, buf, sizeof(buf));
 	if (buf_ctx.error != KNOT_EOK) {
 		return buf_ctx.error;
diff --git a/src/utils/kjournalprint/main.c b/src/utils/kjournalprint/main.c
index e96f86cd572f708d1d5de005d6a5c3c1bdcf2ade..8e5bdb6cf0a7d0bcb697a79e7fed4a04c0859a58 100644
--- a/src/utils/kjournalprint/main.c
+++ b/src/utils/kjournalprint/main.c
@@ -215,9 +215,12 @@ int print_journal(char *path, knot_dname_t *name, print_params_t *params)
 
 static int list_zone(const knot_dname_t *zone, void *ctx)
 {
-	char zone_str[KNOT_DNAME_TXT_MAXLEN + 1];
 	(void)ctx;
-	printf("%s\n", knot_dname_to_str(zone_str, zone, sizeof(zone_str)));
+	knot_dname_txt_storage_t zone_str;
+	if (knot_dname_to_str(zone_str, zone, sizeof(zone_str)) == NULL) {
+		return KNOT_EINVAL;
+	}
+	printf("%s\n", zone_str);
 	return KNOT_EOK;
 }
 
diff --git a/src/utils/knotc/interactive.c b/src/utils/knotc/interactive.c
index 07f72460a471c1ddfcb98891009feff36fadc602..cdde302f7eebb3c1e31390211c43e601b1ab0a4f 100644
--- a/src/utils/knotc/interactive.c
+++ b/src/utils/knotc/interactive.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -58,7 +58,7 @@ static void local_zones_lookup(EditLine *el, const char *str, size_t str_len)
 		return;
 	}
 
-	char buff[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t buff;
 
 	// Fill the lookup with local zone names.
 	for (conf_iter_t iter = conf_iter(conf(), C_ZONE);
diff --git a/src/utils/kzonecheck/zone_check.c b/src/utils/kzonecheck/zone_check.c
index 072a5db2c174191ea674bae1fd881cd764f7269a..4e987852818257d0f38089bddca35485a0dc271a 100644
--- a/src/utils/kzonecheck/zone_check.c
+++ b/src/utils/kzonecheck/zone_check.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -35,12 +35,15 @@ static void err_callback(sem_handler_t *handler, const zone_contents_t *zone,
 	assert(zone != NULL);
 	err_handler_stats_t *stats = (err_handler_stats_t *)handler;
 
-	char buff[KNOT_DNAME_TXT_MAXLEN + 1] = "";
-	(void)knot_dname_to_str(buff, (node != NULL ? node->owner : zone->apex->owner),
-	                        sizeof(buff));
+	knot_dname_txt_storage_t buff;
+	char *owner = knot_dname_to_str(buff, (node != NULL ? node->owner : zone->apex->owner),
+	                                sizeof(buff));
+	if (owner == NULL) {
+		owner = "";
+	}
 
 	fprintf(stats->outfile, "[%s] %s%s%s\n",
-	        buff, sem_error_msg(error),
+	        owner, sem_error_msg(error),
 	        (data != NULL ? " "  : ""),
 	        (data != NULL ? data : ""));
 
diff --git a/tests-fuzz/fuzz_dname_to_str.c b/tests-fuzz/fuzz_dname_to_str.c
index fcc217f1055b8554900093ae58389934e58a8df6..3d091a2bf49b2f2db52d46bdb908c82fdcb38b5c 100644
--- a/tests-fuzz/fuzz_dname_to_str.c
+++ b/tests-fuzz/fuzz_dname_to_str.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
 	}
 
 	// Transform the input.
-	char txt[KNOT_DNAME_TXT_MAXLEN + 1];
+	knot_dname_txt_storage_t txt;
 	(void)knot_dname_to_str(txt, (const knot_dname_t *)data, sizeof(txt));
 
 	return 0;
diff --git a/tests/knot/test_confio.c b/tests/knot/test_confio.c
index 0f86334115d3056a1dd87d2e45a42fab8ad9b575..f314a7c3bb937d776b1d500574b410172123f412 100644
--- a/tests/knot/test_confio.c
+++ b/tests/knot/test_confio.c
@@ -31,7 +31,7 @@
 
 char *format_key(conf_io_t *io)
 {
-	char id[KNOT_DNAME_TXT_MAXLEN + 1] = "\0";
+	knot_dname_txt_storage_t id;
 	size_t id_len = sizeof(id);
 
 	// Get the textual item id.
diff --git a/tests/knot/test_zonedb.c b/tests/knot/test_zonedb.c
index 73d30cb16efc13d8216a5c4916f80d3769235dfc..30beb9a03ddce9b03b75f7e1a0ea94a8d688e1fe 100644
--- a/tests/knot/test_zonedb.c
+++ b/tests/knot/test_zonedb.c
@@ -1,4 +1,4 @@
-/*  Copyright (C) 2018 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/*  Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
 
     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
 	plan_lazy();
 
 	/* Create database. */
-	char buf[KNOT_DNAME_MAXLEN];
+	knot_dname_txt_storage_t buf;
 	const char *prefix = "zzz.";
 	size_t nr_passed = 0;
 	knot_dname_t *dname = NULL;
diff --git a/tests/libknot/test_dname.c b/tests/libknot/test_dname.c
index f5e0c705640eab152cbf94ccde9339c873d7119e..c3bc69f1955f92ebf9f734c4a4040645413daf00 100644
--- a/tests/libknot/test_dname.c
+++ b/tests/libknot/test_dname.c
@@ -29,7 +29,7 @@ static int test_fw(size_t l, const char *w) {
 /* Test dname to/from string operations */
 static void test_str(const char *in_str, const char *in_bin, size_t bin_len) {
 	uint8_t      d1[KNOT_DNAME_MAXLEN] = "";
-	char         s1[4 * KNOT_DNAME_MAXLEN] = "";
+	knot_dname_txt_storage_t s1;
 	knot_dname_t *d2 = NULL, *aux_d = NULL;
 	char         *s2 = NULL, *aux_s = NULL;
 	int          ret = 0;