The existence of solutions to an initial-boundary value problem to the heat equation in a bounded domain in ℝ³ is proved. The domain contains an axis and the existence is proved in weighted anisotropic Sobolev spaces with weight equal to a negative power of the distance to the axis. Therefore we prove the existence of solutions which vanish sufficiently fast when approaching the axis. We restrict our considerations to the Dirichlet problem, but the Neumann and the third boundary value problems can be treated in the same way. The proof of the existence is split into the following steps. First by an appropriate extension of initial data the initial-boundary value problem is reduced to an elliptic problem with a fixed t ∈ ℝ. Applying the regularizer technique it is considered locally. The most difficult part is to show the existence in weighted spaces near the axis, because the existence in neighbourhoods located at a positive distance from the axis is well known. In a neighbourhood of a point where the axis meets the boundary, the elliptic problem considered is transformed to a problem near an interior point of the axis by an appropriate reflection. Using cutoff functions the problem near the axis is considered in ℝ³ with sufficiently fast decreasing functions as |x| → ∞. Then by applying the Fourier-Laplace transform we are able to show an appropriate estimate in weighted spaces and to prove local in space existence. The result of this paper is necessary to show the existence of global regular solutions to the Navier-Stokes equations which are close to axially symmetric solutions.