We consider an inverse problem of identifying the unknown cavities in a heat conductor. Using the Neumann-to-Dirichlet map as measured data, we develop a linear sampling-type method for the heat equation. A new feature is that there is a freedom to choose the time variable, which suggests that we have more data than the linear sampling methods for the inverse boundary value problem associated with EIT and inverse scattering problem with near field data.