Context. The formation of high mass stars and clusters occurs in giant molecular clouds. Objects in evolved stages of massive star formation such as protostars, hot molecular cores, and ultracompact HII regions have been studied in more detail than earlier, colder objects. Further progress thus requires the analysis of the time before massive protostellar objects can be probed by their infrared emission. With this in mind, the APEX Telescope Large Area Survey of the whole inner Galactic plane at 870 μm (ATLASGAL) has been carried out to provide a global view of cold dust and star formation at submillimetre wavelengths. Aims. We derive kinematic distances to a large sample of massive cold dust clumps from their measured line velociti...