We have investigated the performance of the dispersion-corrected density functionals (BLYP-D, BP86-D and PBE-D) and the widely used B3LYP functional for describing the hydrogen bonds and the stacking interactions in DNA base dimers. For the gas-phase situation, the bonding energies have been compared to the best ab initio results available in the literature. All dispersion-corrected functionals reproduce well the ab initio results, whereas B3LYP fails completely for the stacked systems. The use of the proper functional leads us to find minima for the adenine quartets, which are energetically and structurally very different from the C 4h structures, and might explain why adenine has to be sandwiched between guanine quartets to form planar adenine quartets.