The shampoo is used to treat and prevent conditions such as dandruff and seborrheic dermatitis. Ketoconazole works by preventing the fungus from making normal cell walls, thereby stopping fungal growth. This medication may be available under multiple brand names and/or in several different forms.