The distributed order fractional diffusion equations are the generalization of the standard fractional diffusion equations, which arising in modeling the processes lacking power-law scaling over the whole time-domain, such as; ultraslow diffusion where a plume of particles spreads at a logarithmic rate. In this research, a numerical approach is purposed to obtain the numerical solution of this class of the equations of the general form in the time domain with the Caputo fractional derivative. For this purpose, apply the orthogonal Jacobi polynomials via spectral methods. We derive a new operational matrix of the distributed order fractional derivative for Jacobi polynomials by some Gauss quadrature and expand the unknown and known functions of equation (1) by Jacobi polynomials. So the main problem reduces to an algebraic equation and for solving the obtained equation, we discretize it using spectral collocation and Galerkin methods. Numerical examples are provided to show the accuracy and efficiency of the purposed method.