Because of their small size, fruit flies easily enter through the cracks under doors and windows. They lay eggs on rotting fruit and can be brought home in grocery bags. Infestations of fruit flies in kitchen drains are common because they feed on the food scum that collects.
There are a few ways you can attempt to get a fruit fly infestation under control. The first step in preventing an infestation is discarding any overripe or rotting food matter in your home. You may need to thoroughly clean your kitchen drain and replace your trashcan and sponges. A simple fruit fly trap can be made using a glass of vinegar or wine covered in plastic wrap. The trap should have a small opening in the plastic wrap, which the flies will use to enter and become trapped inside the glass. If the number of fruit flies increase, you will require the services of a professional pest control technician.
If your fruit fly problem persists, it likely requires the services of a pest control professional.