  We study the gapped phase of Kitaev's honeycomb model (a $Z_2$ spin liquid)
on a lattice with topological defects. We find that some dislocations and
string defects carry unpaired Majorana fermions. Physical excitations
associated with these defects are (complex) fermion modes made out of two
(real) Majorana fermions connected by a $Z_2$ gauge string. The quantum state
of these modes is robust against local noise and can be changed by winding a
$Z_2$ vortex around one of the dislocations. The exact solution respects gauge
invariance and reveals a crucial role of the gauge field in the physics of
Majorana modes. To facilitate these theoretical developments, we recast the
degenerate perturbation theory for spins in the language of Majorana fermions.
