While diatomaceous earth cannot prevent insects from entering your home, it can help to kill nearly any crawling insect as it enters.
Food grade diatomaceous earth must come in contact with an insect in order for it to kill it. Therefore, it is important to spread the powder in any area where crawling insects may enter your home. As they walk across the DE, the razor-sharp edges of the diatoms will rub against the insect’s body and stick to its waxy outer shell. Eventually, as the particles continue to lacerate the insect’s exoskeleton and the powdery DE dehydrates the insect, it will die.
When sprinkling diatomaceous earth around your home be sure to keep it to areas where it will not be disturbed and kicked up in to the air. Spread the DE along window sills, door frames, along the foundation of your home as well as in any other cracks or crevices where insects might try to enter.
It is very important that you use only food grade diatomaceous earth (and not pool grade) for this purpose.
For information on how long DE may take to kill insects please see: How Long Does Diatomaceous Earth Take to Kill Insects?