diff --git a/src/plugins.c b/src/plugins.c
index 87a7260..85e3745 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -57,6 +57,7 @@
 extern const struct lyplg_type_record plugins_ipv4_address[];
 extern const struct lyplg_type_record plugins_ipv4_address_no_zone[];
 extern const struct lyplg_type_record plugins_ipv6_address[];
+extern const struct lyplg_type_record plugins_ipv6_address_no_zone[];
 extern const struct lyplg_type_record plugins_ipv4_prefix[];
 extern const struct lyplg_type_record plugins_ipv6_prefix[];
 
@@ -425,6 +426,7 @@
     LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ipv4_address), error);
     LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ipv4_address_no_zone), error);
     LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ipv6_address), error);
+    LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ipv6_address_no_zone), error);
     LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ipv4_prefix), error);
     LY_CHECK_GOTO(ret = plugins_insert(LYPLG_TYPE, plugins_ipv6_prefix), error);
 
diff --git a/src/plugins_types/ipv6_address.c b/src/plugins_types/ipv6_address.c
index 923a513..ed320f2 100644
--- a/src/plugins_types/ipv6_address.c
+++ b/src/plugins_types/ipv6_address.c
@@ -36,7 +36,7 @@
 
 /**
  * @page howtoDataLYB LYB Binary Format
- * @subsection howtoDataLYBTypesIPv6Address ipv6-address(-no-zone) (ietf-inet-types)
+ * @subsection howtoDataLYBTypesIPv6Address ipv6-address (ietf-inet-types)
  *
  * | Size (B) | Mandatory | Type | Meaning |
  * | :------  | :-------: | :--: | :-----: |
@@ -140,25 +140,17 @@
 
     if (format == LY_VALUE_LYB) {
         /* validation */
-        if (!strcmp(type->plugin->id, "libyang 2 - ipv6-address-no-zone, version 1")) {
-            if (value_len != 16) {
-                ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv6-address-no-zone value size %zu "
-                        "(expected 16).", value_len);
+        if (value_len < 16) {
+            ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv6-address value size %zu "
+                    "(expected at least 16).", value_len);
+            goto cleanup;
+        }
+        for (i = 16; i < value_len; ++i) {
+            if (!isalnum(value_str[i])) {
+                ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv6-address zone character 0x%x.",
+                        value_str[i]);
                 goto cleanup;
             }
-        } else {
-            if (value_len < 16) {
-                ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv6-address value size %zu "
-                        "(expected at least 16).", value_len);
-                goto cleanup;
-            }
-            for (i = 16; i < value_len; ++i) {
-                if (!isalnum(value_str[i])) {
-                    ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv6-address zone character 0x%x.",
-                            value_str[i]);
-                    goto cleanup;
-                }
-            }
         }
 
         /* allocate the value */
@@ -383,7 +375,7 @@
 }
 
 /**
- * @brief Plugin information for ip-address type implementation.
+ * @brief Plugin information for ipv6-address type implementation.
  *
  * Note that external plugins are supposed to use:
  *
@@ -404,19 +396,5 @@
         .plugin.duplicate = lyplg_type_dup_ipv6_address,
         .plugin.free = lyplg_type_free_ipv6_address
     },
-    {
-        .module = "ietf-inet-types",
-        .revision = "2013-07-15",
-        .name = "ipv6-address-no-zone",
-
-        .plugin.id = "libyang 2 - ipv6-address-no-zone, version 1",
-        .plugin.store = lyplg_type_store_ipv6_address,
-        .plugin.validate = NULL,
-        .plugin.compare = lyplg_type_compare_ipv6_address,
-        .plugin.print = lyplg_type_print_ipv6_address,
-        .plugin.hash = lyplg_type_hash_ipv6_address,
-        .plugin.duplicate = lyplg_type_dup_ipv6_address,
-        .plugin.free = lyplg_type_free_ipv6_address
-    },
     {0}
 };
diff --git a/src/plugins_types/ipv6_address_no_zone.c b/src/plugins_types/ipv6_address_no_zone.c
new file mode 100644
index 0000000..6e5995f
--- /dev/null
+++ b/src/plugins_types/ipv6_address_no_zone.c
@@ -0,0 +1,325 @@
+/**
+ * @file ipv6_address_no_zone.c
+ * @author Michal Vasko <mvasko@cesnet.cz>
+ * @brief ietf-inet-types ipv6-address-no-zone type plugin.
+ *
+ * Copyright (c) 2019-2021 CESNET, z.s.p.o.
+ *
+ * This source code is licensed under BSD 3-Clause License (the "License").
+ * You may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://opensource.org/licenses/BSD-3-Clause
+ */
+
+#define _GNU_SOURCE /* asprintf, strdup */
+#include <sys/cdefs.h>
+
+#include "plugins_types.h"
+
+#include <arpa/inet.h>
+#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__)
+#include <netinet/in.h>
+#include <sys/socket.h>
+#endif
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "libyang.h"
+
+#include "common.h"
+#include "compat.h"
+
+/**
+ * @page howtoDataLYB LYB Binary Format
+ * @subsection howtoDataLYBTypesIPv6AddressNoZone ipv6-address-no-zone (ietf-inet-types)
+ *
+ * | Size (B) | Mandatory | Type | Meaning |
+ * | :------  | :-------: | :--: | :-----: |
+ * | 16       | yes       | `struct in6_addr *` | IPv6 address in network-byte order |
+ */
+
+/**
+ * @brief Stored value structure for ipv6-address-no-zone
+ */
+struct lyd_value_ipv6_address_no_zone {
+    struct in6_addr addr;
+};
+
+static void lyplg_type_free_ipv6_address_no_zone(const struct ly_ctx *ctx, struct lyd_value *value);
+
+/**
+ * @brief Convert IP address to network-byte order.
+ *
+ * @param[in] value Value to convert.
+ * @param[in] value_len Length of @p value.
+ * @param[in] options Type store callback options.
+ * @param[in,out] addr Allocated value for the address.
+ * @param[out] err Error information on error.
+ * @return LY_ERR value.
+ */
+static LY_ERR
+ipv6addressnozone_str2ip(const char *value, size_t value_len, uint32_t options, struct in6_addr *addr, struct ly_err_item **err)
+{
+    LY_ERR ret = LY_SUCCESS;
+    const char *addr_str;
+    char *addr_dyn = NULL;
+
+    /* get the IP terminated with zero */
+    if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+        /* we can use the value directly */
+        addr_str = value;
+    } else {
+        addr_dyn = strndup(value, value_len);
+        addr_str = addr_dyn;
+    }
+
+    /* store the IPv6 address in network-byte order */
+    if (!inet_pton(AF_INET6, addr_str, addr)) {
+        ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Failed to convert IPv6 address \"%s\".", addr_str);
+        goto cleanup;
+    }
+
+cleanup:
+    free(addr_dyn);
+    return ret;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_store_clb for the ipv6-address-no-zone ietf-inet-types type.
+ */
+static LY_ERR
+lyplg_type_store_ipv6_address_no_zone(const struct ly_ctx *ctx, const struct lysc_type *type, const void *value,
+        size_t value_len, uint32_t options, LY_VALUE_FORMAT format, void *UNUSED(prefix_data), uint32_t hints,
+        const struct lysc_node *UNUSED(ctx_node), struct lyd_value *storage, struct lys_glob_unres *UNUSED(unres),
+        struct ly_err_item **err)
+{
+    LY_ERR ret = LY_SUCCESS;
+    struct lysc_type_str *type_str = (struct lysc_type_str *)type;
+    struct lyd_value_ipv6_address_no_zone *val;
+
+    /* zero storage so we can always free it */
+    memset(storage, 0, sizeof *storage);
+
+    if (format == LY_VALUE_LYB) {
+        /* validation */
+        if (value_len != 16) {
+            ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL, "Invalid LYB ipv6-address-no-zone value size %zu "
+                    "(expected 16).", value_len);
+            goto cleanup;
+        }
+
+        /* init storage */
+        storage->_canonical = NULL;
+        storage->ptr = NULL;
+        storage->realtype = type;
+
+        if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+            /* use the value directly */
+            storage->ptr = (void *)value;
+            options &= ~LYPLG_TYPE_STORE_DYNAMIC;
+        } else {
+            /* allocate the value */
+            val = malloc(sizeof *val);
+            LY_CHECK_ERR_GOTO(!val, ret = LY_EMEM, cleanup);
+            storage->ptr = val;
+
+            /* store IP address */
+            memcpy(&val->addr, value, sizeof val->addr);
+        }
+
+        /* success */
+        goto cleanup;
+    }
+
+    /* check hints */
+    ret = lyplg_type_check_hints(hints, value, value_len, type->basetype, NULL, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    /* length restriction of the string */
+    if (type_str->length) {
+        /* value_len is in bytes, but we need number of characters here */
+        ret = lyplg_type_validate_range(LY_TYPE_STRING, type_str->length, ly_utf8len(value, value_len), value, value_len, err);
+        LY_CHECK_GOTO(ret, cleanup);
+    }
+
+    /* pattern restrictions */
+    ret = lyplg_type_validate_patterns(type_str->patterns, value, value_len, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    /* allocate the value */
+    val = calloc(1, sizeof *val);
+    LY_CHECK_ERR_GOTO(!val, ret = LY_EMEM, cleanup);
+
+    /* init storage */
+    storage->_canonical = NULL;
+    storage->ptr = val;
+    storage->realtype = type;
+
+    /* get the network-byte order address */
+    ret = ipv6addressnozone_str2ip(value, value_len, options, &val->addr, err);
+    LY_CHECK_GOTO(ret, cleanup);
+
+    if (format == LY_VALUE_CANON) {
+        /* store canonical value */
+        if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+            ret = lydict_insert_zc(ctx, (char *)value, &storage->_canonical);
+            options &= ~LYPLG_TYPE_STORE_DYNAMIC;
+            LY_CHECK_GOTO(ret, cleanup);
+        } else {
+            ret = lydict_insert(ctx, value_len ? value : "", value_len, &storage->_canonical);
+            LY_CHECK_GOTO(ret, cleanup);
+        }
+    }
+
+cleanup:
+    if (options & LYPLG_TYPE_STORE_DYNAMIC) {
+        free((void *)value);
+    }
+
+    if (ret) {
+        lyplg_type_free_ipv6_address_no_zone(ctx, storage);
+    }
+    return ret;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_compare_clb for the ipv6-address-no-zone ietf-inet-types type.
+ */
+static LY_ERR
+lyplg_type_compare_ipv6_address_no_zone(const struct lyd_value *val1, const struct lyd_value *val2)
+{
+    struct lyd_value_ipv6_address_no_zone *v1 = val1->ptr, *v2 = val2->ptr;
+
+    if (val1->realtype != val2->realtype) {
+        return LY_ENOT;
+    }
+
+    if (memcmp(&v1->addr, &v2->addr, sizeof v1->addr)) {
+        return LY_ENOT;
+    }
+    return LY_SUCCESS;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_print_clb for the ipv6-address-no-zone ietf-inet-types type.
+ */
+static const void *
+lyplg_type_print_ipv6_address_no_zone(const struct ly_ctx *ctx, const struct lyd_value *value, LY_VALUE_FORMAT format,
+        void *UNUSED(prefix_data), ly_bool *dynamic, size_t *value_len)
+{
+    struct lyd_value_ipv6_address_no_zone *val = value->ptr;
+    char *ret;
+
+    if (format == LY_VALUE_LYB) {
+        *dynamic = 0;
+        if (value_len) {
+            *value_len = sizeof val->addr;
+        }
+        return &val->addr;
+    }
+
+    /* generate canonical value if not already */
+    if (!value->_canonical) {
+        /* '%' + zone */
+        ret = malloc(INET6_ADDRSTRLEN);
+        LY_CHECK_RET(!ret, NULL);
+
+        /* get the address in string */
+        if (!inet_ntop(AF_INET6, &val->addr, ret, INET6_ADDRSTRLEN)) {
+            free(ret);
+            LOGERR(ctx, LY_EVALID, "Failed to get IPv6 address in string (%s).", strerror(errno));
+            return NULL;
+        }
+
+        /* store it */
+        if (lydict_insert_zc(ctx, ret, (const char **)&value->_canonical)) {
+            LOGMEM(ctx);
+            return NULL;
+        }
+    }
+
+    /* use the cached canonical value */
+    if (dynamic) {
+        *dynamic = 0;
+    }
+    if (value_len) {
+        *value_len = strlen(value->_canonical);
+    }
+    return value->_canonical;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_hash_clb for the ipv6-address-no-zone ietf-inet-types type.
+ */
+static const void *
+lyplg_type_hash_ipv6_address_no_zone(const struct lyd_value *value, ly_bool *dynamic, size_t *key_len)
+{
+    /* simply use the LYB value */
+    return lyplg_type_print_ipv6_address_no_zone(NULL, value, LY_VALUE_LYB, NULL, dynamic, key_len);
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_dup_clb for the ipv6-address-no-zone ietf-inet-types type.
+ */
+static LY_ERR
+lyplg_type_dup_ipv6_address_no_zone(const struct ly_ctx *ctx, const struct lyd_value *original, struct lyd_value *dup)
+{
+    LY_ERR ret;
+    struct lyd_value_ipv6_address_no_zone *orig_val = original->ptr, *dup_val;
+
+    ret = lydict_insert(ctx, original->_canonical, ly_strlen(original->_canonical), &dup->_canonical);
+    LY_CHECK_RET(ret);
+
+    dup_val = malloc(sizeof *dup_val);
+    if (!dup_val) {
+        lydict_remove(ctx, dup->_canonical);
+        return LY_EMEM;
+    }
+    memcpy(&dup_val->addr, &orig_val->addr, sizeof orig_val->addr);
+
+    dup->ptr = dup_val;
+    dup->realtype = original->realtype;
+    return LY_SUCCESS;
+}
+
+/**
+ * @brief Implementation of ::lyplg_type_free_clb for the ipv6-address-no-zone ietf-inet-types type.
+ */
+static void
+lyplg_type_free_ipv6_address_no_zone(const struct ly_ctx *ctx, struct lyd_value *value)
+{
+    struct lyd_value_ipv6_address *val = value->ptr;
+
+    lydict_remove(ctx, value->_canonical);
+    free(val);
+}
+
+/**
+ * @brief Plugin information for ipv6-address-no-zone type implementation.
+ *
+ * Note that external plugins are supposed to use:
+ *
+ *   LYPLG_TYPES = {
+ */
+const struct lyplg_type_record plugins_ipv6_address_no_zone[] = {
+    {
+        .module = "ietf-inet-types",
+        .revision = "2013-07-15",
+        .name = "ipv6-address-no-zone",
+
+        .plugin.id = "libyang 2 - ipv6-address-no-zone, version 1",
+        .plugin.store = lyplg_type_store_ipv6_address_no_zone,
+        .plugin.validate = NULL,
+        .plugin.compare = lyplg_type_compare_ipv6_address_no_zone,
+        .plugin.print = lyplg_type_print_ipv6_address_no_zone,
+        .plugin.hash = lyplg_type_hash_ipv6_address_no_zone,
+        .plugin.duplicate = lyplg_type_dup_ipv6_address_no_zone,
+        .plugin.free = lyplg_type_free_ipv6_address_no_zone
+    },
+    {0}
+};
