Receptor-interacting serine/threonine protein kinase 2 (RIPK2) and RIPK3 have been demonstrated to be promising targets for treating multiple inflammatory diseases, including inflammatory bowel diseases (IBDs). Due to the complexity of IBD pathogenesis, on the basis of synergy strategies, we herein describe the discovery and optimization of a series of N,7-diaryl-quinazolin-4-amine derivatives as dual RIPK2 and RIPK3 inhibitors. Based on a step-by-step process involving three rounds of structural modifications, compound 29 was identified as the most one, exhibiting balanced potency against RIPK2 (IC50 = 12 nM) and RIPK3 (IC50 = 18 nM), as well as demonstrating good selectivity over other kinase targets. Further biological evaluation confirmed that compound 29 could bind directly to RIPK2 and RIPK3, effectively suppressing NOD-induced cytokine production and cellular necroptosis. Notably, compound 29 displayed significant therapeutic effects in a DSS-induced colitis mouse model, with no detectable toxicity, indicating its promising therapeutic potential as RIPK2/RIPK3 dual inhibitors for treatment of IBD.