A theory is given of the density of states (DOS) of a two-dimensional electron gas subjected to a uniform perpendicular magnetic field and any random field, adequately taking into account the realistic correlation function of the latter. For a random field of any long-range correlation, a semiclassical non-perturbative path-integral approach is developed and provides an analytic solution for the Landau level DOS. For a random field of any arbitrary correlation, a computational approach is developed. In the case when the random field is smooth enough, the analytic solution is found to be in very good agreement with the computational solution. It is proved that there is not necessarily a universal form for the Landau level DOS. The classical DOS exhibits a symmetric Gaussian form whose width depends merely on the rms potential of the random field. The quantum correction results in an asymmetric non-Gaussian DOS whose width depends not only on the rms potential and correlation length of the random field, but the applied magnetic field as well. The deviation of the DOS from the Gaussian form is increased when reducing the correlation length and/or weakening the magnetic field. Applied to a modulation-doped quantum well, the theory turns out to be able to give a quantitative explanation of experimental data with no fitting parameters.