||The visual systems of many animals feature energetically costly specializations to enable them to function in dim light. It is often unclear, however, how large the behavioural benefit of these specializations is, because a direct comparison in a behaviourally relevant task between closely related day- and night-active species is not usually possible. Here we compared the orientation performance of diurnal and nocturnal species of dung beetles, Scarabaeus (Kheper) lamarcki and Scarabaeus satyrus, respectively, attempting to roll dung balls along straight paths both during the day and at night. Using video tracking, we quantified the straightness of paths and the repeatability of roll bearings as beetles exited a flat arena in their natural habitat or under controlled conditions indoors. Both species oriented equally well when either the moon or an artificial point light source was available, but when the view of the moon was blocked and only wide-field cues such as the lunar polarization pattern or the stars were available for orientation, nocturnal beetles were oriented substantially better. We found no evidence that ball-rolling speed changed with light level, which suggests little or no temporal summation in the visual system. Finally, we found that both diurnal and nocturnal beetles tended to choose bearings that led them towards a bright light source, but away from a dim one. Our results show that even diurnal insects, at least those with superposition eyes, could orient by the light of the moon, but that dim-light adaptations are needed for precise orientation when the moon is not visible.