1/2 cup molasses
1/4 cup granulated sugar
1 envelope dry yeast
Mix all & smear a little on small squares of cardboard, then place wherever ants are coming in such as behind appliances.
There are a few other tips that will help you control the ants that enter your home as well. Always be sure to trim any tree or shrub branches that touch or overhang your home.
Seal cracks with silicone caulking to prevent access. Check around outlets to see if ants have been entering through them, this is a frequent access hole. You can seal unused outlets with safety covers. This includes areas where utility lines enter the home, air conditioning, refrigerant pipes, telephone and cable lines, etc.
Sprinkle food grade Diatomaceous Earth (DE) around any areas where you've seen them enter the home.
Ants will only remain in areas where they have moisture, so near pipes, under cupboards in bathrooms and kitchens, leaking eaves, water damage within walls and under window sills. Carpenter ants are quite destructive and LOVE wet/damp insulation. If you're seeing ants in the winter months, chances are you have a serious carpenter ant infestation and they WILL Literally EAT your house, much like a termite.
Here is a photo that was taken of friends home in Maine, where a carpenter ant infestation devastated the home. This shot is a close up of a sill that had moisture damage, a perfect home to a carpenter ant:
Avoid stacking firewood on your porch, deck or near the house as this encourages nesting in columns, pillars and ventilators.
If you don't have small children or pets you can add 1/2 cup of borax per gallon of hot water to the mop water and wash the floors with it. This will remove the pheromones that have been left behind by other ants and will deter them from the house.
If you do have kids/pets, add peppermint essential oil to the mop water instead of borax, it will have the same effect. We use 2 tsp dawn dishsoap, 60 drops of Peppermint essential oil and 2 gallons of hot water. Mop as you normally would, rinsing is not required.
If ants are a problem in your pets food dishes, draw a line around the dish using white chalk or petroleum jelly. This will prevent the ants from crawling into the dish. Alternatively, you can use a 9"x9" foil pan, place the food dish in the center, then add water to the aluminum pan. This is particular effective if you have an outdoor pet food dish as the ants drown before they reach the food.