Many drug molecules inhibit the conduction of several families of cation channels by binding to a small cavity just below the selectivity filter of the channel protein. The exact mechanisms governing drug-channel binding and the subsequent inhibition of conduction are not well understood. Here the inhibition of two K(+) channel isoforms, Kv1.2 and KCa3.1, by two drug molecules, lidocaine and TRAM-34, is examined in atomic detail using molecular dynamics simulations. A conserved valine-alanine-valine motif in the inner cavity is found to be crucial for drug binding in both channels, consistent with previous studies of similar systems. Potential of mean force calculations show that lidocaine in its charged form creates an energy barrier of ∼6 kT for a permeating K(+) ion when the ion is crossing over the drug, while the neutral form of lidocaine has no significant effect on the energetics of ion permeation. On the other hand, TRAM-34 in the neutral form is able to create a large energy barrier of ∼10 kT by causing the permeating ion to dehydrate. Our results suggest that TRAM-34 analogues that remain neutral and permeable to membranes under acidic conditions common to inflammation may act as possible drug scaffolds for combating local anesthetic failure in inflammation.