Lower the relative humidity in your home by installing a dehumidifier and by using ventilation fans in bathrooms and laundry rooms. Excess moisture is the leading cause of mold growth and lowering it in your home will help prevent a high level of spores that could get into your dishwasher. Relative humidity should be below 60 percent.
Keep your dishwasher door open after every cycle until the dishwasher is completely dry. This will prevent you from trapping water vapor and humidity inside the dishwasher.
Pour 1 cup white vinegar in the bottom of your dishwasher before every cycle. White vinegar will kill any microscopic mold spores in the dishwasher.
Run the dishwasher at least one per week. Mold tends to grow in dishwashers that aren't used very often.