1) When purchasing an electric dishwasher for a new kitchen, if one has been blessed with the means to purchase two machines which drain into two separate sinks, one for meat and one for dairy, that is ideal and praiseworthy thing to do.
Having two dishwashers helps prevent many kashrus questions which often arise with only one dishwasher, and affords the Balabusta (Jewish housewife) much more Menuchas Hanefesh (peace of mind)
2) However, it isn't always possible or practical to have two machines, and thus the following Halachos must be known in order to maintain a kosher kitchen with only one dishwasher.
One who purchases a home or apartment with an existing dishwasher, must ascertain whether the dishwasher is Kosher or not.
If it isn't Kosher or if it is impossible to find out from a reliable source whether it is Kosher or not, the dishwasher will require koshering before being acceptable for further use.
Halachos for Shabbos Kodesh
1) A dishwasher that was used for both meat and dairy, or which was used by previous non Jewish owners to wash utensils used with non kosher food, according to some Poskim cannot be koshered at all(especially if there is a filter in the washing chamber) and a new machine must be purchased. (See The laws of Kashrus by Rav Binyomin Forst Shlita, page 261-262 for more details)
Other Poskim maintain that koshering is possible in many instances, and when allowed, can be koshered as follows:
* The entire dishwasher must be thoroughly cleaned
* 24 hours must be waited, and the machine not used, from when it's cleaned until it can be koshered.
* The machine should then be run [on the highest possible heat setting, if possible] for a full cycle. (See Igros Moshe Orach Chaim Vol. 3 Siman 58. If it doesnt reach a high enough temparature of 100F or more, it may be problematic.)
2) If parts of the dishwasher are porcelain, plastic or constructed from materials other than metal or stainless steel, it can further complicate the koshering process or make it impossible. (See Kovetz M'bais Leivi Vol. 1 page 30)
Whenever koshering a dishwasher , especially for Pesach use, a Rav must be consulted to determine if and how it should be done. (See also Kitzur Shulchan Aruch Yalkut Yosef page 589 for some leniencies for Sephardim)