Food Grade Diatomaceous Earth (D.E.)
One of Mother Nature's great equalizers, D.E. is a fine white powder that is a natural byproduct of fossilized hard-shelled algae. It kills any insect with an exoskeleton, such as the fruit fly (Drosophila melanogaster) and fungus gnat (Lycoriella spp. and Bradysia spp.). Food Grade D.E. is generally harmless to humans and traditional pets, save the potential for mild eye irritation. For fruits with rinds or peels, like lemons, oranges, and bananas, gently sift some D.E. after rinsing and place in a fruit basket.
It is important to pay attention to the grade of D.E. purchased. There is "Food/Natural" or "Pool." Pool Grade is chemically altered to treat pool water, and therefore has toxic components that are harmful to humans and pets if consumed. This is not the case with Food Grade. To find Food/Natural Grade D.E. talk to a local feed store or garden center and specifically ask for Food/Natural Grade diatomaceous earth. Avoid pool specific stores or sections, as all of that D.E. has been chemically altered.
Ye Olde Standby
Take a glass jar and fill it with some water. Add some apple cider vinegar and a splash of juice. The vinegar attracts fruit flies, like catnip calls to felines. Vinegar also happens to change the chemical composition of water. Fruit flies are buoyant in water. However, the necessary surface resistance changes with the addition of vinegar. Therefore, the flies sink rather than hover.
Thou Shalt Harm None
Take a tube from a roll of paper towels and diagonally cut tips on each end. Inside a glass jar, place fruit peels or rotten fruit, like a banana. Affix the tube to the glass jar using a strong adhesive tape, like Gorilla or duct. Make sure that the tape makes a seal around the tube and the mouth of the jar. Fruit flies go down the tube, but do not fly out of the jar. Take the jar to an area away from your dwelling, remove the tape and tube, and allow the flies to go free.
In addition, it is helpful not to have dirty dishes left in the sink. Keep surface areas wiped down, and avoid throwing fruit and vegetable scraps into indoor garbage can. If you happen to keep a recycling bin outside the house, but by a door, make sure all items are well rinsed and sprinkle some D.E. to discourage flies.
This is Deb Duxbury, for Animal Life, reminding you to please spay or neuter your pet.