The name gnats (pronounced nats) actually refers to a number of small flying bugs, most commonly fruit flies. Regardless, they're a nuisance. When asked how to get rid of gnats or fruit flies house, the most important step is to first get rid of the food source that's attracting them. Fruit flies are drawn to moist organic foods, such as over-ripe or rotting fruit or vegetables. They can also be attracted to garbage or even food left on a sponge. Fortunately, the life span of a gnat or fruit fly is a short two weeks. Once the sources have been removed, to kill the flies and those that will soon hatch, you can turn to fruit fly traps sold in stores or a bug zapper.