☎ (559) 472-8200
Serving Fresno & Central Valley

Home › Learn › How to Get Rid of Gnats

TINY FLY ID GUIDE

How to Get Rid of Gnats, Fruit Flies & Drain Flies

A licensed Fresno tech explains how to tell fruit flies, fungus gnats, and drain flies apart, and how to kill them at the source instead of swatting adults.

By Paul Outfleet, Licensed Pest Control Professional · Updated June 2026

The short answer

To get rid of gnats, fruit flies, and drain flies, you must kill the breeding source, not the adults. Fruit flies breed in produce and recycling, fungus gnats in overwatered plant soil, and drain flies in drain biofilm. Identify which one you have, then clean that source out completely.

A single fuzzy, moth-like drain fly resting on white porcelain beside a bathroom sink drain in a Fresno home
A drain fly's fuzzy, moth-like wings give it away. If you see these near a sink or tub, the breeding source is biofilm inside the drain itself.

The 3-second ID: which tiny fly do you actually have?

Before you do anything, figure out what's flying around. "Gnat" gets used as a catch-all, but the four tiny flies we see in Fresno homes breed in completely different places, and the wrong treatment wastes your time. Here's how a tech tells them apart at a glance.

Fruit fly vs. fungus gnat vs. drain fly vs. house fly

FlyLooks likeWhere it breedsHow you'll spot it
Fruit flyTan/brown, ~3mm, often red eyesRipening produce, recycling, drains, spillsHovering over fruit bowls and recycling bins
Fungus gnatBlack, slender, long legs, weak flierDamp, overwatered potting soilDrifting up from houseplants and patio pots
Drain flyFuzzy, moth-like, dark greyBiofilm sludge inside drainsResting on walls near sinks, tubs, floor drains
House flyLarger, ~6mm, grey thoraxGarbage, decaying matter, wasteBigger, faster, buzzing around windows and food

Fruit flies: the produce and recycling problem

Fruit flies are the classic kitchen swarm, and in Fresno they barely take a winter off. Our long warm season keeps them active most of the year, so a single forgotten tomato or a sticky recycling bin can seed a population fast. They lay eggs on the surface of fermenting fruit, in the film at the bottom of a recycling bin, and even in the gunk of a kitchen drain.

The fix is a two-parter: remove the breeding material (toss overripe produce, rinse recyclables, wipe up spills), then trap the remaining adults. The apple cider vinegar trap genuinely works for fruit flies: pour an inch of cider vinegar into a cup, add a drop of dish soap to break the surface tension, and cover with plastic wrap poked with a few holes. The vinegar smells like fermentation, the flies dive in, and the soap sinks them.

Fungus gnats: blame the overwatered houseplant

If the tiny black flies are drifting up from your plants rather than your fruit bowl, those are fungus gnats, and the cause is almost always wet soil. The larvae live in the top inch of damp potting mix and feed on the fungi, organic matter, and tender roots there. Summer is peak season here: people over-water patio pots and houseplants to fight the Valley heat, and that constantly-moist soil is a fungus gnat nursery.

A cluster of tiny black fungus gnats on the damp soil surface of a potted houseplant
Fungus gnats breed in the top inch of overwatered potting soil. Letting the soil dry between waterings is the single most effective fix.

Vinegar traps barely touch fungus gnats because the source isn't fruit, it's soil. Instead, let the top inch or two of soil dry out completely between waterings, which kills the larvae, and switch to bottom-watering so the surface stays dry. A layer of sand or fine gravel on top helps. Yellow sticky cards catch the adults while the life cycle, which runs roughly three to four weeks, plays out. Keeping plant soil drier is also a smart move when you pest-proof your Fresno home against moisture-loving pests in general.

Drain flies: the biofilm in your pipes

Drain flies are fuzzy and moth-like, and they sit on the wall near a sink or tub rather than zipping around food. They breed in the biofilm, the slimy organic gunk coating the inside of a drain; the larvae live in that film and feed on the bacteria and decaying matter in it. Older Fresno homes with slow or seldom-used drains, like a guest bathroom or a floor drain, are prime real estate for them.

Confirm the source with the tape test: at night, tape a strip across the drain opening, sticky side down (leave a gap so air still moves). Flies stuck to the tape by morning means that drain is the breeding site. To clean it, pour boiling water down, then scrub the inside walls of the pipe with a stiff drain brush to physically remove the biofilm, and follow with an enzyme drain cleaner. A chemical pour alone usually skims past the biofilm without removing it, so the mechanical scrub is the part that matters.

Why sprays fail, and how to actually kill the source

Here's the honest truth a lot of products won't tell you: a can of fly spray kills the adults you can see, but it does nothing to the eggs and larvae breeding out of sight. The population simply replenishes itself in a day or two. Real control means starving the source. Work this sequence for whichever fly you've identified:

Identify the fly using the table above so you treat the right breeding site, not a guess.

Remove the breeding material: toss overripe produce and rinse recycling for fruit flies; let plant soil dry for fungus gnats; scrub drain biofilm for drain flies.

Deep-clean the surrounding zone: wipe counters and spills, empty and rinse bins, and flush slow drains with boiling water.

Set the right trap for the adults: a cider-vinegar-and-soap cup for fruit flies, yellow sticky cards for fungus gnats.

Wait out the life cycle: most of these flies need about three to four weeks for the eggs and larvae already in place to die off, so keep traps up and don't quit early.

Re-check with the tape test or a fresh trap after a few weeks; lingering activity means you missed a source or there's a hidden one.

Get a Home Pest Inspection

When tiny flies signal a bigger problem

Most tiny-fly outbreaks are a tidy-up job. But a swarm that just will not quit after you've cleaned every obvious source is often pointing at moisture or organic matter you can't see. Common hidden culprits: a slow plumbing leak feeding a damp wall cavity, a dead rodent in a wall or crawlspace, or a cracked sewer line letting drain flies breed underground.

If you've removed the produce, dried the soil, scrubbed the drains, and the flies keep coming, that persistence is a clue worth taking seriously. A licensed tech can trace the source and check for the moisture or pest issue behind it. Knowing which pests peak in which months also helps you stay ahead of recurring swarms, our Fresno pest control calendar lays that out, and ongoing home pest control service keeps the breeding conditions in check year-round.

Gnats, Fruit Flies & Drain Flies FAQ

Where are all these gnats coming from?

They're breeding somewhere in your home, not flying in from outside. The three usual sources are ripening produce or recycling (fruit flies), the damp soil of an overwatered houseplant (fungus gnats), and the biofilm sludge inside a drain (drain flies). Identify which fly you have, and the source becomes obvious.

What kills gnats instantly?

A spray or a vacuum kills the adults you can see instantly, but that's only a fraction of the population. Eggs and larvae keep hatching, so the swarm returns within a day or two. There's no true instant fix, lasting control comes from removing the breeding source, not zapping individual adults.

Why do I suddenly have gnats in my house?

A sudden swarm usually traces to one new trigger: a fresh bag of produce, a recently overwatered or newly purchased plant with infested soil, or a drain that's gone slow and built up biofilm. Warm, humid conditions speed up breeding, which is why outbreaks spike in Fresno's long warm season.

Does apple cider vinegar get rid of gnats?

Apple cider vinegar traps work well for fruit flies, which are drawn to the fermentation smell, especially with a drop of dish soap added. They do little for fungus gnats (which breed in soil, not fruit) or drain flies (which breed in pipes). Match the trap to the fly, or it won't help.

What's the difference between gnats and fruit flies?

Fruit flies are tan or brown, often red-eyed, and hover over fruit and recycling. "Gnats" usually means fungus gnats: smaller, black, slender, long-legged, and drifting up from plant soil. They breed in totally different places, so telling them apart decides whether you trap produce or dry out your potting soil.

Still battling a swarm that won't quit?

If you've cleaned every source and the flies keep coming, there may be a hidden leak or moisture problem behind it. Our licensed Fresno techs can trace the source and treat it at the root. Schedule a no-cost home inspection today.