CDCA7 , encoding a protein with a carboxyl-terminal cysteine-rich domain (CRD), is mutated in immunodeficiency, centromeric instability, and facial anomalies (ICF) syndrome, a disease related to hypomethylation of juxtacentromeric satellite DNA. How CDCA7 directs DNA methylation to juxtacentromeric regions is unknown. Here, we show that the CDCA7 CRD adopts a unique zinc-binding structure that recognizes a CpG dyad in a non-B DNA formed by two sequence motifs. CDCA7, but not ICF mutants, preferentially binds the non-B DNA with strand-specific CpG hemi-methylation. The unmethylated sequence motif is highly enriched at centromeres of human chromosomes, whereas the methylated motif is distributed throughout the genome. At S phase, CDCA7, but not ICF mutants, is concentrated in constitutive heterochromatin foci, and the formation of such foci can be inhibited by exogenous hemi-methylated non-B DNA bound by the CRD. Binding of the non-B DNA formed in juxtacentromeric regions during DNA replication provides a mechanism by which CDCA7 controls the specificity of DNA methylation.