Most species of terrestrial snakes can burrow into loose soil or sand, although very few can do so in packed earth. Holes used as burrows by snakes are typically created by other animals, such as rodents. Snakes generally prefer tree hollows or the cover provided by rocks or foliage.
Snakes are attracted to burrows that provide a tight fit, which makes it difficult for predators to enter. Semiaquatic snakes often use the burrows made by crayfish and frogs near water. African and Asian sand boas are skilled at displacing sand to bury themselves, although sand rarely works for creating burrows.