  In this paper, several classes of three-weight ternary linear codes from
non-weakly regular dual-bent functions are constructed based on a generic
construction method. Instead of the whole space, we use the subspaces $B_+(f)$
or $B_-(f)$ associated with a ternary non-weakly regular dual-bent function
$f$. Unusually, we use the pre-image sets of the dual function $f^*$ in
$B_+(f)$ or $B_-(f)$ as the defining sets of the corresponding codes. Since the
size of the defining sets of the constructed codes is flexible, it enables us
to construct several codes with different parameters for a fixed dimension. We
represent the weight distribution of the constructed codes. We also give
several examples.
