Sterilizing

Can I just dump all the bottles and pacifiers in a pot and boil them for 5 minutes to sterilize? Is that the way it works? Or is better to put them in the dishwasher and do it that way?