The far-infrared dielectric function of a wide range of organic molecules is dominated by vibrations involving a substantial fraction of the atoms forming the molecule and motion associated with intermolecular hydrogen bond vibrations. Due to their collective nature such modes are highly, sensitive to the intra- and intermolecular structure and thus provide a unique fingerprint of the conformational state of the molecule and effects of its environment. We demonstrate the use of terahertz time-domain spectroscopy (THz-TDS) for recording the far-infrared (0.5-4.0 THz) dielectric function of the four nucleobases and corresponding nucleosides forming the building blocks of deoxyribose nucleic acid (DNA). We observe numerous distinct spectral features with large differences between the molecules in both frequency-dependent absorption coefficient and index of refraction. Assisted by results from density-functional calculations we interpret the origin of the observed resonances as vibrations of hydrogen bonds between the molecules.