Active galactic nuclei (AGNs) make up about 35 per cent of the more than 250 sources detected in very-high-energy (VHE) gamma rays to date with Imaging Atmospheric Cherenkov Telescopes. Apart from four nearby radio galaxies and two AGNs of unknown type, all known VHE AGNs are blazars. Knowledge of the cosmological redshift of gamma-ray blazars is key to enabling the study of their intrinsic emission properties, as the interaction between gamma rays and the extragalactic background light (EBL) results in a spectral softening. Therefore, the redshift determination exercise is crucial to indirectly placing tight constraints on the EBL density and to studying blazar population evolution across cosmic time. Due to the powerful relativistic jets in blazars, most of their host galaxies’ spectral features are outshined, and dedicated high signal-to-noise spectroscopic observations are required. Deep medium- to high-resolution spectroscopy of 33 gamma-ray blazar optical counterparts was performed with the European Southern Observatory New Technology Telescope, Keck II telescope, Shane 3-meter telescope and the Southern African Large Telescope. From the sample, spectra from 25 objects display spectral features or are featureless and have high signal-to-noise. The other eight objects have low quality featureless spectra. We systematically searched for absorption and emission features and estimated, when possible, the fractional host galaxy flux in the measured total flux. Our measurements yielded 14 firm spectroscopic redshifts, ranging from 0.0838 to 0.8125, one tentative redshift, and two lower limits: one at z > 0.382 and the other at z > 0.629.