Of all the flying pests, gnats might be the most annoying. Though they're harmless, they hover and buzz around our heads, driving us crazy. Gnats are also known as vinegar flies or fruit flies because of their attraction to the smell of rotten food. This explains why they particularly enjoy the areas around drains and trash cans.
Gnats are most commonly found around fruit, saturated house plants, compost piles, and other rotting, smelly food or plants. The problem is there's no such thing as one gnat. In fact, one gnat can lay two to three hundred eggs in its two to four month life span. If you frequently see gnats hovering around your sink drain or trash can, there's a good chance they're laying eggs inside your home.
If you don't want gnats around, you have to cut off their food supply. This means fruits and vegetables have to go in the refrigerator or a bin the bugs can't penetrate. Make sure house plants stay damp, but not wet, and they must have the proper drainage. Gnats just love over-watered house plants. Empty trashcans regularly and don't allow rotting food to sit in the house. Make sure all trash receptacles and sink drains are cleaned thoroughly, and don't have any old rancid food stuck to them. Never let dirty dishes stand in the sink.
Your best recourse is chemicals. The supermarket and hardware stores have several flying insect spray options for you to choose from. Just about any one of these will take care of your gnat problem. Be sure to check the back of the label to make certain it isn't harmful to pets. If your home is experiencing an all-out infestation, you may need to look into a fogging product. This will require you to seal off cabinets and anywhere else food and eating implements are stored. Be sure to take the pets and leave the house for the day.
You can also get rid of gnats by using products found around the home. Since they are attracted to the scent of vinegar, fill a jar with vinegar and poke holes in the lid. The gnats will climb into the jar, but they won't be able to climb out. For those that remain in the house, try putting vegetable oil around your kitchen sink drain. Gnats finding themselves coated in the oil will be unable to breed. If you're not interested in potentially clogging your drain with vegetable oil, pouring a cup of ammonia down your kitchen sink is said to get rid of any flies hovering around that area. Let it sit for a couple of hours before using the sink again.
Gnats are a source of irritation for many, but you don't have to let this happen to you. Dispose of food properly and don't over water your house plants. If gnats do get in the house, act quickly before one or two bugs become an infestation. Save your irritation for something else... like mosquitoes.