Although HPA – axis reactivity has repeatedly been related to cognitive functioning, ambiguity remains regarding the direction of the effect, i.e. whether it benefits or impairs functioning. Genetic factors that contribute to HPA – axis reactivity on the one hand and to cognitive functioning on the other could therefore help clarify the association between stress and cognition. We genotyped 10 single nucleotide polymorphisms (SNPs) on the NR3C1 gene (rs10482682, rs33389, rs10482633, rs10515522, rs2963156, rs4128428, rs9324918, rs41423247, rs6189, rs10052957) coding for the glucocorticoid receptor (GR) and 4 SNPs on the NR3C2 gene (rs6810951, rs4635799, rs11099695, rs2070950) coding for the mineralocorticoid receptor (MR) and required N = 126 healthy males to perform tasks assessing attention and reasoning before and after experiencing an acute laboratory stressor (the Socially Evaluated Cold Pressor Test, SECPT). Haplotype analyses revealed significant effects of NR3C1 (p = 0.011) and NR3C2 (p = 0.034) on cortisol stress response. NR3C2 also influenced attentional performance via an interaction with stress-induced cortisol response (p < 0.001). Neither NR3C1 haplotype nor NR3C2 haplotype was associated with reasoning abilities. Results suggest that the association between stress induced cortisol reactivity and cognition strongly depends on genetic variation. The idea of an optimal arousal level depending on stress reactivity and genetic disposition is discussed.