There are many different species of fly that travel indoors and present various problems for the inhabitants of a home. If the flies take up residence in your home, it is common to observe both the larval and adult lifestages of the fly. The drain fly is a perfect example of these indoor fly nuisance pests, so named due to the tendency of both larval and adult forms to hover around sink drains.
Drain flies (family Psychodidae), also called moth flies, are a common pest of both homes and sewage treatment plants. Like most indoor flies, drain flies are considered a nuisance rather than a hazard, though they are capable of transmitting diseases to humans. The flies are most frequently seen at rest on walls and ceilings and will jump short distances when disturbed.
Drain Fly Larvae
When a homeowner reports black worms near her sink drain, these are most often the larval form of drain flies. Attracted indoors by a source of moisture, adult drain flies prefer to breed in standing water, particularly any standing water that may be slightly polluted. As the larvae develop, they feed on decaying organic matter, microorganisms, algae and sediment in the water until pupating into adult form. Development into adult drain flies usually takes 9 to 15 days.
Even though their presence is associated with water pollution, drain flies are sometimes considered beneficial insects since they can help purify contaminated water by feeding on water contaminants. Still, the rather bizarre appearance of black worms in your bathroom or kitchen sink drains is often reason enough to remove the worms. Removing the contaminated water that attracts the flies indoors in the first place will often eliminate the drain flies from returning to that spot to breed. You may additionally need to use a long-handled brush or "snake" to clean any decaying organic matter deep in the drain.
Other Control Approaches
Should basic cleanliness fail to remove the drain fly infestation, you can use a bacteria complex gel to eliminate the organic matter in drain water that is attracting the flies. As a last resort, you can use a pyrethrin or resmethrin insecticide to kill adult flies, but note that this approach will do nothing to prevent more drain flies from coming up the drain again until the source of decay or contamination is located and eliminated.