I am trying to find the number of groups $G$ (up to isomorphism) such that $G/\mathbb{Z}_3\cong D_{2n}$, where $\mathbb{Z}_3$ denotes the cyclic group of order $3$ and $D_{2n}$ denotes the dihedral group of order $2n$.
I first consider the case when $G\cong\mathbb{Z}_3:D_{2n}$, a semi-direct product.
I tried to use N/C lemma first: let $\langle a\rangle$ be the normal subgroup of $G$ which is isomorphic to $\mathbb{Z}_3$, then $G/C_G(a) = N_G(a)/C_G(a)$ is isomorphic to a subgroup of $\mathrm{Aut}(\mathbb{Z}_3)\cong\mathbb{Z}_2$. Hence $|C_G(a)| = 3n$ or $6n$. Let $H = \langle b\rangle:\langle c\rangle\cong\mathbb{Z}_n:\mathbb{Z}_2\cong D_{2n}$, a semi-direct product, with $c^{-1}bc = b^{-1}$.
If $|C_G(a)| = 6n$ then $G\cong\mathbb{Z}_3\times D_{2n}$.
Otherwise $|C_G(a)| = 3n$, then $|C_H(a)| = n$, which means a subgroup of $H$ of order $n$ is commutative with $\langle a\rangle$.
If $n$ is odd, then the only subgroup of $H\cong D_{2n}$ of order $n$ is isomorphic to $\mathbb{Z}_n$, which is exactly $\langle b\rangle$. Thus $G = (\langle a\rangle\times\langle b\rangle):\langle c\rangle\cong(\mathbb{Z}_3\times\mathbb{Z}_n):\mathbb{Z}_2$. But how can I find $\mathrm{Aut}(\mathbb{Z}_3\times\mathbb{Z}_n)$? If $\gcd(3,n) = 1$ then the result of the direct product is a cyclic group and so $G\cong D_{6n}$. But what if $\gcd(3,n)\ne 1$?
If $n$ is even, then it is more complicated since there are two more subgroups of $H$ of order $n$, see Normal subgroups of dihedral groups, both of which are isomorphic to $D_n$. Thus there is a possibility that $G\cong(\mathbb{Z}_3\times D_{n}):\mathbb{Z}_2$, and what's that?
What if the extension is not a semi-direct product, and what if $\mathbb{Z}_3$ is replaced by a bigger cyclic group? (May be better if avoid calculating the cohomology group.)
I also wonder if there is any mistake in my analysis.
Thank you in advance!