Human immunodeficiency virus type 1 (HIV-1) integrase is one of three virally encoded enzymes essential for replication and, therefore, a rational choice as a drug target for the treatment of HIV-1-infected individuals. In 2007, raltegravir became the first integrase inhibitor approved for use in the treatment of HIV-infected patients, more than a decade since the approval of the first protease inhibitor (saquinavir, Hoffman La-Roche, 1995) and two decades since the approval of the first reverse transcriptase inhibitor (retrovir, GlaxoSmithKline, 1987). The slow progress toward a clinically effective HIV-1 integrase inhibitor can at least in part be attributed to a poor structural understanding of this key viral protein. Here we describe the development of a restrained molecular dynamics protocol that produces a more accurate model of the active site of this drug target. This model provides an advance on previously described models as it ensures that the catalytic DDE motif makes correct, monodentate interactions with the two active-site magnesium ions. Dynamic restraints applied to this coordination state create models with the correct solvation sphere for the metal ion complex and highlight the coordination sites available for metal-binding ligands. Application of appropriate dynamic flexibility to the core domain allowed the inclusion of multiple conformational states in subsequent docking studies. These models have allowed us to (1) explore the effects of key drug resistance mutations on the dynamic flexibility and conformational preferences of HIV integrase and to (2) study raltegravir binding in the context of these dynamic models of both wild type and the G140S/Q148H drug-resistant enzyme.