We study the electron spin resonance (ESR) of low-dimensional spin systems at high temperature, and test the Kubo-Tomita theory of exchange narrowing. In finite-size systems (molecular magnets), we found a double-peak resonance which strongly differs from the usual Lorentzian. For infinite systems, we have predictions for the linewidth and lineshape as a function of the anisotropy strength. For this, we have used an interpolation between a non-perturbative calculation of the memory function at short times (exact diagonalization) and the hydrodynamic spin-diffusion at long times. We show that the Dzyaloshinskii-Moriya anisotropies generally induce a much larger linewidth than the exchange anisotropies in two dimensions, contrary to the one-dimensional case.