Insertion of viral dna into host-cell dna. This includes integration of phage dna into bacterial dna; (lysogeny); to form a PROPHAGE or integration of retroviral dna into cellular dna to form a PROVIRUS.