Using the Milburn equation, we have studied the properties of the entanglement and fidelity dynamics in a spin system with different Dzyaloshinskii-Moriya interaction and magnetic field in detail. Effects of different Dzyaloshinskii-Moriya interaction, different magnetic fields, and the initial states on the entanglement and fidelity are discussed. Results show that entanglement decoherence can be suppressed by inhomogeneous magnetic fields. Initial state affects greatly the entanglement, and a proper entanglement can be obtained by adjusting the directions of Dzyaloshinskii-Moriya interaction. For a particular initial state, an optimal fidelity is obtained by changing the direction of the Dzyaloshinskii-Moriya interaction. Moreover, no matter how homogeneous or inhomogeneous the magnetic fields are, they cannot enhance the fidelity. The dependence of entanglement and fidelity on the angle of initial state shows periodicity. Hence we can select an optimal initial state for a specific condition according to requirement.