  We calculate the dispersion measures (DMs) contributed by host galaxies of
fast radio bursts (FRBs). Based on a few host galaxy observations, a large
sample of galaxy with similar properties to observed ones has been selected
from the IllustrisTNG simulation. They are used to compute the distributions of
host galaxy DMs for repeating and non-repeating FRBs. For repeating FRBs, we
infer the DM$ _{\mathrm{host}} $ for FRBs like FRB 121102 and FRB 180916 by
assuming that the burst sites are tracing the star formation rates in host
galaxies. The median DM$_{\mathrm{host}}$ are $35 (1+z)^{1.08}$ and
$96(1+z)^{0.83}$ pc cm$^{-3}$ for FRBs like FRB 121102 and FRB 180916,
respectively. In another case, the median of DM$_{\mathrm{host}}$ is about $30
- 70$ pc cm$^{-3}$ for non-repeating FRBs in the redshift range $z=0.1-1.5$,
assuming that the burst sites are the locations of binary neutron star mergers.
In this case, the evolution of the median DM$_{\mathrm{host}}$ can be
calculated by $33(1+z)^{0.84}$ pc cm$^{-3}$. The distributions of
DM$_{\mathrm{host}}$ of repeating and non-repeating FRBs can be well fitted
with the log-normal function. Our results can be used to infer redshifts of
non-localized FRBs.
