Strong CP problem is known to be solved by imposing Peccei-Quinn (PQ) symmetry.However, domain wall problem caused by the spontaneous breaking of its remnant discrete subgroup could make models invalid in many cases. We propose a model in which the PQ charge is assigned quarks so as to escape this problem without introducing any extra colored fermions. In the low energy effective model resulting after the PQ symmetry breaking, both the quark mass hierarchy and the CKM mixing could be explained through Froggatt-Nielsen mechanism. If the model is combined with the lepton sector supplemented by an inert doublet scalar and right-handed neutrinos, the effective model reduces to the scotogenic neutrino mass model in which both the origin of neutrino masses and dark matter are closely related. The strong CP problem could be related to the quark mass hierarchy, neutrino masses and dark matter through the PQ symmetry. *