Catalyzes the NAD-dependent oxidation of the highly active 17beta-hydroxysteroids, such as estradiol (E2), testosterone (T), and dihydrotestosterone (DHT), to their less active forms and thus regulates the biological potency of these steroids. Oxidizes estradiol to estrone, testosterone to androstenedione, and dihydrotestosterone to 5alpha-androstan-3,17-dione. Also has 20-alpha-HSD activity. {ECO:0000269|PubMed:10385431, ECO:0000269|PubMed:11940569, ECO:0000269|PubMed:8099587}. This is the function of HSD17B2 (hydroxysteroid 17-beta dehydrogenase 2, ENSG00000086696).