Novel 2-amino-4-(4-methoxyphenyl)-6-(piperidin-1-yl)pyridine-3,5-dicarbonitrile is synthesized using malononitrile, 4-methoxybenzaldehyde and piperidine as starting material in methanol by one-spot. The yield is 40% with three-component reaction at room temperature. The structure is confirmed by 1H NMR, MS and X-ray single crystal diffraction.