Halogen bonding in water results in enhanced anion recognition in acyclic and rotaxane hosts.