We present optical spectroscopy secured at the 10 m Gran Telescopio
Canarias of the counterparts of 20 extragalactic γ-ray sources
detected by the Fermi satellite. The observations allow us to
investigate the nature of these sources and to determine their redshift.
We find that all optical counterparts have a spectrum that is consistent
with a BL Lac object nature. We are able to determine the redshift for
11 objects and set spectroscopic redshift limits for five targets. The
optical spectrum is found featureless for only four sources. In the
latter cases, we can set lower limits on the redshift based on the
assumption that they are hosted by a typical massive elliptical galaxy
whose spectrum is diluted by the nonthermal continuum. The observations
allow us to unveil the nature of these gamma-ray sources and provide a
sanity check of a tool to discover the counterparts of γ-ray
emitters/blazars based on their multiwavelength emission.