  The bright BL Lac object TXS 0506+056 is a most likely counterpart of the
IceCube neutrino event EHE 170922A. The lack of this redshift prevents a
comprehensive understanding of the modeling of the source. We present high
signal-to-noise optical spectroscopy, in the range 4100-9000 $\textrm{\AA}$,
obtained at the 10.4m Gran Telescopio Canarias. The spectrum is characterized
by a power law continuum and is marked by faint interstellar features. In the
regions unaffected by these features, we found three very weak (EW $\sim$ 0.1
$\textrm{\AA}$) emission lines that we identify with [O II] 3727
$\textrm{\AA}$, [O III] 5007 $\textrm{\AA}$, and [N II] 6583 $\textrm{\AA}$,
yielding the redshift z = 0.3365$\pm$0.0010.
