DNA methyltransferases (DNMTs) catalyze methylation at the C5 position of cytosine with S-adenosyl-L-methionine. Methylation regulates gene expression, serving a variety of physiological and pathophysiological roles. The chemical mechanisms regulating DNMT enzymatic activity, however, are not fully elucidated. Here, we show that protein S-nitrosylation of a cysteine residue in DNMT3B attenuates DNMT3B enzymatic activity and consequent aberrant upregulation of gene expression. These genes include Cyclin D2 (Ccnd2), which is required for neoplastic cell proliferation in some tumor types. In cell-based and in vivo cancer models, only DNMT3B enzymatic activity, and not DNMT1 or DNMT3A, affects Ccnd2 expression. Using structure-based virtual screening, we discovered chemical compounds that specifically inhibit S-nitrosylation without directly affecting DNMT3B enzymatic activity. The lead compound, designated DBIC, inhibits S-nitrosylation of DNMT3B at low concentrations (IC50 ≤ 100 nM). Treatment with DBIC prevents nitric oxide (NO)-induced conversion of human colonic adenoma to adenocarcinoma in vitro. Additionally, in vivo treatment with DBIC strongly attenuates tumor development in a mouse model of carcinogenesis triggered by inflammation-induced generation of NO. Our results demonstrate that de novo DNA methylation mediated by DNMT3B is regulated by NO, and DBIC protects against tumor formation by preventing aberrant S-nitrosylation of DNMT3B.