According to Natural News, gnats are attracted to warm, moist environments and decomposing produce. Swarms of gnats congregate in swampy areas, such as creek beds and soggy riverbanks. They are also attracted to rotting garbage and indoor pools of standing water, such as sinks full of dirty dishes and stagnant refrigerator drainage trays.
"Gnat" is the name commonly used to describe a wide variety of small winged insects; however, in most cases, the flying insects that most people call "gnats" are really fruit flies or fungus gnats. These gnats feed on plants, other insects or blood, and they can be biting or non-biting creatures, depending on the species.
Fungus gnats lay their eggs in plant soil that has been over-watered. When their eggs hatch, young fungus gnats feed on the decomposing organic material in the soil. Plant roots are commonly affected as gnats feed on the roots and root hairs. Although most harmful to small plants, fungus gnats can also destroy large plants, depending on the health of the plant and the size of the gnat infestation.
Fruit flies lay their eggs in extra-ripe or fermenting fruit, and they can be seen hovering near these foods as well as they are attracted to their scent and moisture. When the eggs hatch, the larvae eat the fruit.
Natural News states that essential gnat prevention measures include washing and drying all dirty dishes, promptly drying laundered clothing and changing the water in pet bowls at least once per day. Household bleach is a powerful weapon in the fight against gnats. Adding a few drops to refrigerator drain trays and kitchen sink drip pans keeps gnats away and kills existing eggs and larvae. Flushing pipes with a solution of hot water and chlorine bleach kills gnat larva in deep hiding places. If the pipes have blockages of hair, food or other detritus, an effective solution is to use a foaming drain cleaner followed by regular bleach treatments.
Orkin Pest Control reveals that over-watered houseplants also attract gnats. Bleach is not an option in these cases because it is toxic to plants as well as gnats. To get rid of gnats in potted soil, gently mist the plant with warm, distilled water mixed with several drops of lemon-scented dish detergent. Blood also attracts gnats. Orkin Pest Control encourages homeowners to clean up spilled blood with a solution of hot, soapy water and bleach.