We have calculated the electronic energy loss of proton and α-particle beams in dry DNA using the dielectric formalism. The electronic response of DNA is described by the MELF-GOS model, in which the outer electron excitations of the target are accounted for by a linear combination of Mermin-type energy-loss functions that accurately matches the available experimental data for DNA obtained from optical measurements, whereas the inner-shell electron excitations are modeled by the generalized oscillator strengths of the constituent atoms. Using this procedure we have calculated the stopping power and the energy-loss straggling of DNA for hydrogen- and helium-ion beams at incident energies ranging from 10 keV/nucleon to 10 MeV/nucleon. The mean excitation energy of dry DNA is found to be I = 81.5 eV. Our present results are compared with available calculations for liquid water showing noticeable differences between these important biological materials. We have also evaluated the electron excitation probability of DNA as a function of the transferred energy by the swift projectile as well as the average energy of the target electronic excitations as a function of the projectile energy. Our results show that projectiles with energy ≲100 keV/nucleon (i.e., around the stopping-power maximum) are more suitable for producing low-energy secondary electrons in DNA, which could be very effective for the biological damage of malignant cells.