  In recent years, there has been intensive research on the ${\mathbb
Q}$-linear relations between multiple zeta (star) values. In this paper, we
prove many families of identities involving the $q$-analog of these values,
from which we can always recover the corresponding classical identities by
taking $q\to 1$. The main result of the paper is the duality relations between
multiple zeta star values and Euler sums and their $q$-analogs, which are
generalizations of the Two-one formula and some multiple harmonic sum
identities and their $q$-analogs proved by the authors recently. Such duality
relations lead to a proof of the conjecture by Ihara et al. that the Hoffman
$\star$-elements $\zeta^{\star}(s_1,\dots,s_r)$ with $s_i\in\{2,3\}$ span the
vector space generated by multiple zeta values over ${\mathbb Q}$.
