Abstract The basic structure of comet nuclei is an aggregation of grains, with a size distribution that extends over several orders of magnitude and a similar distribution of pores. Although attempts have been made to assess the effect of porosity on the thermal conductivity, the effect of pore size distribution has been ignored. Modeling a porous structure with a wide size distribution would require a very fine 3-D grid, so as to accommodate the smallest and largest voids. In order to circumvent this difficulty, we adopt a hierarchical procedure. Thus we assume a random and fractal porous structure and use a 3-D Monte Carlo model. The basic configuration is a cube made of unit cells of two types, (ice) filled and void, randomly distributed. Their relative number corresponds to a prescribed porosity. We solve the heat transport equation for this cube until a steady state is obtained, and from this solution the effective thermal conductivity is derived. The calculations are repeated for a range of porosities and temperatures, since the ice conductivity is temperature dependent. The basic cube serves as a unit filled cell in a larger cube, and in this way the hierarchical structure of the medium is built up. We find that the thermal conductivity is lowered by several orders of magnitude at high porosities. The correction factor, obtained as a fit to the results of our calculations, is expressed as a smooth function of the porosity, which tends to zero as the porosity approaches the percolation threshold of the solid. If only the porosity of the medium is known, this correction is not uniquely determined, but rather a range of values is possible. Only if the size distribution of the pores is known does the correction become uniquely determined.