Epigenetics play an important role in viral replication and in viral associated pathogenesis. In fact, viruses interact with epigenetic factors to promote the viral replication by stimulating the entry into the lytic cycle, but also by promoting viral latency. Furthermore, epigenetics control the immune response implemented by the host to counteract viral infections. Thus, epigenetic modifications are identified as potential therapeutic targets to control viral infections. Several studies have already shown the efficiency of inhibitors of histone deacetylases, demethylases, acetyltransferases and methyltransferases, as well as inhibitors of DNA methyltransferases in viral infections repression or in latency reactivation. In this review, we will examine the epigenetic regulation of viral infections by several DNA viruses, e.g. HSV, EBV, HCMV, KSHV, HBV, HPV and HAdV, and RNA viruses, e.g. HCV, HIV, IAV and CoV. Also, we will discuss the potential use of therapeutic approaches targeting epigenetics for the control of viral infections.