We develop an approach for determining the orientation of DNA bases attached to carbon nanotubes (CNTs), by combining ab initio time-dependent density functional theory and optical spectroscopy measurements. The structures we find are in good agreement with the geometry of nucleosides on a (10,0) CNT obtained from molecular simulations using empirical force fields. The results shed light into the complex interactions of the DNA-CNT system, a candidate for ultrafast DNA sequencing through electronic probes.