Dust temperature is an important property of the interstellar medium (ISM) of galaxies. It is required when converting (sub)millimetre broad-band flux to total infrared luminosity (LIR), and hence star formation rate, in high-redshift galaxies. However, different definitions of dust temperatures have been used in the literature, leading to different physical interpretations of how ISM conditions change with, e.g. redshift and star formation rate. In this paper, we analyse the dust temperatures of massive ($M_{\rm star} \gt 10^{10}\, \mathrm{M}_{\odot }$) $z$ = 2–6 galaxies with the help of high-resolution cosmological simulations from the Feedback in Realistic Environments (fire) project. At $z$ ∼ 2, our simulations successfully predict dust temperatures in good agreement with observations. We find that dust temperatures based on the peak emission wavelength increase with redshift, in line with the higher star formation activity at higher redshift, and are strongly correlated with the specific star formation rate. In contrast, the mass-weighted dust temperature, which is required to accurately estimate the total dust mass, does not strongly evolve with redshift over $z$ = 2–6 at fixed IR luminosity but is tightly correlated with LIR at fixed $z$. We also analyse an ‘equivalent’ dust temperature for converting (sub)millimetre flux density to total IR luminosity, and provide a fitting formula as a function of redshift and dust-to-metal ratio. We find that galaxies of higher equivalent (or higher peak) dust temperature (‘warmer dust’) do not necessarily have higher mass-weighted temperatures. A ‘two-phase’ picture for interstellar dust can explain the different scaling relations of the various dust temperatures.