Recent single molecule experiments have reported that DNA binding proteins (DNA-BPs) can diffuse along DNA. This suggests that interactions between proteins and DNA play a role during the target search even far from their specific site on DNA. Here we show by means of Monte Carlo simulations and analytical calculations that there is a counterintuitive repulsion between the two oppositely charged macromolecules at a nanometer range. For the concave shape of DNA-BPs, and for realistic protein charge densities, we find that the DNA-protein interaction free energy has a minimum at a finite surface-to-surface separation, in which proteins can easily slide. When a protein encounters its target, the free energy barrier is completely counterbalanced by the H-bond interaction, thus enabling the sequence recognition.