Many viruses, with distinct replication strategies, activate DNA-damage response pathways, including the lentivirus human immunodeficiency virus (HIV) and the DNA viruses Epstein–Barr virus (EBV), herpes simplex virus 1, adenovirus and SV40. DNA-damage response pathways involving DNA-dependent protein kinase, ataxia-telengiectasia mutated (ATM) and ‘ataxia-telengiectasia and Rad3-related’ (ATR) have all been implicated. This review focuses on the effects of HIV and EBV replication on DNA repair pathways. It has been suggested that activation of cellular DNA repair and recombination enzymes is beneficial for viral replication, as illustrated by the ability of suppressors of the ATM and ATR family to inhibit HIV replication. However, activation of DNA-damage response pathways can also promote apoptosis. Viruses can tailor the cellular response by suppressing downstream signalling from DNA-damage sensors, as exemplified by EBV. New small-molecule inhibitors of the DNA-damage response pathways could therefore be of value to treat viral infections.