Terahertz (THz) quantum-cascade lasers (QCLs) are currently unparalleled for high-resolution spectroscopy of very sharp absorption lines (linewidths below 100 MHz) in the range between 2 and 5.4 THz. Since the frequency range accessible by a single QCL is determined by its typically very limited tuning range, a particular QCL has to be fabricated for each specific application. We quantitatively analyze the frequencies of the modes in THz QCLs with a Fabry–Pérot resonator as a function of its length taking into account waveguide dispersion. Based on these results, we develop a process based on mechanical polishing of the front facet to adjust the emission frequency with a precision of 1 GHz. The demonstrated process makes it possible to reliably fabricate THz QCLs for the spectroscopy of very sharp absorption lines.