  The dispersion measure(DM) of fast radio burst encodes important information
such as its distance, properties of intervening medium. Based on simulations in
the Illustris and IllustrisTNG projects, we analyze the DM of FRBs contributed
by the interstellar medium and circumgalactic medium in the hosts,
$\rm{DM_{host}}$. We explore two population models - tracing the star formation
rate (SFR), and the stellar mass, i.e. young and old progenitors respectively.
The distribution of $\rm{DM_{host}}$ shows significant differences at $z=0$
between two populations: the stellar mass model exhibits an excess at the low
DM end with respect to the SFR model. The SFR (stellar mass) model has a median
value of $\rm{DM_{host}}$=179 (63) $\rm{pc\, cm^{-3}}$ for galaxies with
$M_*=10^{8-13}\,M_{\odot}$ in the TNG100-1. Galaxies in the Illustris-1 have a
much smaller $\rm{DM_{host}}$. The distributions of $\rm{DM_{host}}$ deviate
from log-normal function for both models. Furthermore, two populations differ
moderately in the spatial offset from host galaxy's center, in the stellar mass
function of hosts. $\rm{DM_{host}}$ increases with the stellar mass of hosts
when $M_*<10^{10.5}\,M_{\odot}$, and fluctuate at higher mass. At $0<z<2$,
$\rm{DM_{host}}$ increases with redshift. The differences in $\rm{DM_{host}}$
between two populations declines with increasing redshift. With more localized
events available in the future, statistics such as $\rm{DM_{host}}$, the offset
from galaxy center and the stellar mass function of hosts will be of great
helpful to ascertain the origin of FRB. Meanwhile, statistics of
$\rm{DM_{host}}$ of localized FRB events could help to constrain the baryon
physics models in galaxy evolution.
