The less toxic and generally more effective triazole antifungal agents fluconazole and itraconazole are usually preferred for systemic use. In 2013 the European Medicines Agency's Committee on Medicinal Products for Human Use (CHMP) recommended that a ban be imposed on the use of oral ketoconazole for systemic use in humans throughout the European Union, after concluding that the risk of serious liver injury from systemic ketoconazole outweighs its benefits. The oral formulation of ketoconazole was discontinued in Australia in 2013 and in China in 2015.
Ketoconazole has activity against many kinds of fungi that may cause human disease, such as Candida, Histoplasma, Coccidioides, and Blastomyces (although it is not active against Aspergillus). First synthesized in 1977, ketoconazole was the first orally-active azole antifungal medication. However, ketoconazole has largely been replaced as a first-line systemic antifungal medication by other azole antifungal agents, such as itraconazole, because of ketoconazole's greater toxicity, poorer absorption, and more limited spectrum of activity.
Ketoconazole is used orally in dosages of 200 to 400 mg per day in the treatment of superficial and deep fungal infections.
As an antiandrogen, ketoconazole operates through at least two mechanisms of action. First, and most notably, high oral doses of ketoconazole (e.g. 400 mg three times per day) block both testicular and adrenal androgen biosynthesis, leading to a reduction in circulating testosterone levels. It produces this effect through inhibition of 17α-hydroxylase and 17,20-lyase, which are involved in the synthesis and degradation of steroids, including the precursors of testosterone. Due to its efficacy at reducing systemic androgen levels, ketoconazole has been used with some success as a treatment for androgen-dependent prostate cancer. Second, ketoconazole is an androgen receptorantagonist, competing with androgens such as testosterone and dihydrotestosterone (DHT) for binding to the androgen receptor. This effect is thought to be quite weak however, even with high oral doses of ketoconazole.
When administered orally, ketoconazole is best absorbed at highly acidic levels, so antacids or other causes of decreased stomach acid levels will lower the drug's absorption. Absorption can be increased by taking it with an acidic beverage, such as cola. Ketoconazole is very lipophilic and tends to accumulate in fatty tissues.
Resistance to ketoconazole has been observed in a number of clinical fungal isolates, including Candida albicans. Experimentally, resistance usually arises as a result of mutations in the sterol biosynthesis pathway. Defects in the sterol 5-6 desaturase enzyme reduce the toxic effects of azole inhibition of the 14-alpha demethylation step. Multidrug-resistance (MDR) genes can also play a role in reducing cellular levels of the drug. As azole antifungals all act at the same point in the sterol pathway, resistant isolates are normally cross-resistant to all members of the azole family. 
Ketoconazole shampoo in conjunction with an oral 5α-reductase inhibitor has been used off label to treat androgenic alopecia. The antifungal properties of ketoconazole reduce scalp microflora and consequently may reduce follicular inflammation that contributes to alopecia.
Limited clinical studies suggest ketoconazole shampoo used either alone or in combination with other treatments may be useful in reducing hair loss.
It is a pregnancy category C drug because animal testing has shown it to cause teratogenesis when administered in high doses. Recently, the administration of systemic ketoconazole to two pregnant women for treatment of Cushing's syndrome was reported to have no adverse effects, but this small sample precludes drawing any meaningful conclusions. A subsequent trial in Europe failed to show a risk to infants of mothers receiving ketoconazole.
On July 2013, the U.S. Food and Drug Administration (FDA) issued a warning that taking ketoconazole orally can cause severe liver injuries and adrenal gland problems. It recommends Nizoral oral tablets should not be a first-line treatment for any fungal infection. Nizoral should be used for the treatment of certain fungal infections, known as endemic mycoses, only when alternative antifungal therapies are not available or tolerated.
The topical formulations of Nizoral have not been associated with liver damage, adrenal problems, or drug interactions. These formulations include creams, shampoos, foams, and gels applied to the skin, unlike the Nizoral tablets, which are taken by mouth.
^Zelefsky MJ, Eastham JA, Sartor OA, Kantoff P (2008). DeVita VT, Lawrence TS, Rosenberg SA, ed. Cancer: Principles & Practice of Oncology (8th ed.). Philadelphia: Lippincott Williams & Wilkins. p. 1443. ISBN9780781772075.
^Loli P, Berselli ME, Tagliaferri M (December 1986). "Use of ketoconazole in the treatment of Cushing's syndrome". J. Clin. Endocrinol. Metab.63 (6): 1365–71. doi:10.1210/jcem-63-6-1365. PMID3023421.
^Duret C, Daujat-Chavanieu M, Pascussi JM, Pichard-Garcia L, Balaguer P, Fabre JM, Vilarem MJ, Maurel P, Gerbal-Chaloin S (2006). "Ketoconazole and miconazole are antagonists of the human glucocorticoid receptor: consequences on the expression and function of the constitutive androstane receptor and the pregnane X receptor". Mol. Pharmacol.70 (1): 329–39. doi:10.1124/mol.105.022046. PMID16608920.
^Piérard-Franchimont C, De Doncker P, Cauwenbergh G, Piérard GE (1998). "Ketoconazole shampoo: effect of long-term use in androgenic alopecia". Dermatology (Basel)196 (4): 474–7. doi:10.1159/000017954. PMID9669136.
^Piérard-Franchimont C, Goffin V, Henry F, Uhoda I, Braham C, Piérard GE (October 2002). "Nudging hair shedding by antidandruff shampoos. A comparison of 1% ketoconazole, 1% piroctone olamine and 1% zinc pyrithione formulations". Int J Cosmet Sci24 (5): 249–56. doi:10.1046/j.1467-2494.2002.00145.x. PMID18498517.
^Khandpur S, Suman M, Reddy BS (August 2002). "Comparative efficacy of various treatment regimens for androgenetic alopecia in men". J. Dermatol.29 (8): 489–98. PMID12227482.
^Berwaerts J, Verhelst J, Mahler C, Abs R (June 1999). "Cushing's syndrome in pregnancy treated by ketoconazole: case report and review of the literature". Gynecol. Endocrinol.13 (3): 175–82. doi:10.3109/09513599909167552. PMID10451809.
^Heeres J, Backx LJ, Mostmans JH, Van Cutsem J (August 1979). "Antimycotic imidazoles. part 4. Synthesis and antifungal activity of ketoconazole, a new potent orally active broad-spectrum antifungal agent". J. Med. Chem.22 (8): 1003–5. doi:10.1021/jm00194a023. PMID490531.