diff -Naurp bind-9.9.5/bin/dig/dighost.c bind-9.9.5.oden/bin/dig/dighost.c --- bind-9.9.5/bin/dig/dighost.c 2014-02-02 13:59:37.269247706 +0100 +++ bind-9.9.5.oden/bin/dig/dighost.c 2014-02-02 13:59:47.847248298 +0100 @@ -2147,10 +2147,13 @@ setup_lookup(dig_lookup_t *lookup) { if (lookup->origin != NULL) { result = libidn_locale_to_utf8 (lookup->origin->origin, utf8_str); check_result (result, "convert origin to UTF-8"); - if (len + strlen (utf8_str) < MXNAME) - (void) strcpy (utf8_name + len, utf8_str); - else - fatal ("Too long name + origin"); + if (len > 0 && utf8_name[len - 1] != '.') { + utf8_name[len++] = '.'; + if (len + strlen (utf8_str) < MXNAME) + (void) strcpy (utf8_name + len, utf8_str); + else + fatal ("Too long name + origin"); + } } result = libidn_utf8_to_ascii (utf8_name, ascii_name);