We investigate the microscopic nature of the magnetism in honeycomb iridium-based systems. We show that the minimal model describing the magnetism in A$_2$IrO$_3$ includes both isotropic and anisotropic Kitaev-type spin-exchange interactions between nearest and next-nearest neighbor Ir ions, and that the magnitude of the Kitaev interaction between next-nearest neighbor Ir magnetic moments is comparable with nearest neighbor interactions. We computed the low temperature phase diagram of the effective model with classical Monte Carlo simulations. Due to the presence of the anisotropic Kitaev interactions and the frustration introduced by the competition of the spin couplings between nearest and next-nearest neighbors, the resulting phase diagram is very rich. It contains both various commensurate states and incommensurate single-Q and multi-Q phases, whose regions of stability are controlled by the ratios between competing exchange constants. We showed that the second neighbor Kitaev term plays an important role in the stabilization of the commensurate antiferromagnetic zigzag phase which has been experimentally observed in Na$_2$IrO$_3$. In our simulations, we found this phase to be the ground state for parameters of the model of
both the correct signs and magnitudes.