Many organic co-solutes are known to stabilize or to destabilize native structures of proteins or DNA. Most of these effects can be explained by co-solute binding or exclusion mechanisms. A beneficial approach to study the underlying principles relies on the computation of Kirkwood--Buff integrals, which can be also used to derive detailed expressions for transfer free energies and changes of the chemical equilibrium between the unfolded and the native states. In this article, we use the framework of Kirkwood--Buff theory in order to study the influence of ectoine on the stability of short DNA hairpins. Our results highlight a strong binding of ectoine, which reveals a pronounced destabilization of DNA in good agreement with experimental findings.