  The impurities of exchange couplings, external magnetic fields and
Dzyaloshinskii--Moriya (DM) interaction considered as Gaussian distribution,
the entanglement in one-dimensional random $XY$ spin systems is investigated by
the method of solving the different spin-spin correlation functions and the
average magnetization per spin. The entanglement dynamics at central locations
of ferromagnetic and antiferromagnetic chains have been studied by varying the
three impurities and the strength of DM interaction. (i) For ferromagnetic spin
chain, the weak DM interaction can improve the amount of entanglement to a
large value, and the impurities have the opposite effect on the entanglement
below and above critical DM interaction. (ii) For antiferromagnetic spin chain,
DM interaction can enhance the entanglement to a steady value. Our results
imply that DM interaction strength, the impurity and exchange couplings (or
magnetic field) play competing roles in enhancing quantum entanglement.
