We report here an effort to use molecular dynamics/free energy perturbation methodology to calculate relative binding affinities of two related drugs to DNA. Specifically, we focus on the relative binding free energies of distamycin (Dst) and its analog, 2-imidazoledistamycin (2-ImD), to d(CGCAAGTTGGC).d(GCCAACTTGCG). The pyrrole (Dst) and the imidazole variant (2-ImD) differ only in that the C-H is substituted by an N in the central ring. The starting conformation for these calculations was the previously determined solution structure of two 2-ImD molecules in the minor groove of the above 11-residue DNA. In this complex both the ligands have the imidazole nitrogen (N3) oriented toward the amino group of G(6). However only ligand 1 (site I) has N3 within the hydrogen bonding distance from N2 amino proton of G(6). We have calculated the difference in free energy of binding of 2-ImD versus Dst in three different cases by mutating 2-ImD --> Dst reversibly. In the first case ligand 1 (site I) is mutated, in the second case ligand 2 (site II) is mutated, and in the third case both the ligands are mutated. These calculations show that at site I Dst has weaker binding affinity than 2-ImD by 0.7 kcal/mol, at site II Dst has stronger binding affinity than 2-ImD by 2.9 kcal/mol, and when occupying both site I and site II, Dst binds with greater affinity than 2-ImD by 1.8 kcal/mol. Recent experimental findings agree semiquantitatively (within 1 kcal/mol) with the calculations presented here. Hence the methodology presented here can be used to predict relative binding energies of two or more closely related molecules to DNA.