Biological channels embedded in cell membranes regulate ionic transport by responding to external stimuli such as pH, voltage, and molecular binding. Mimicking the gating properties of these biological structures would be instrumental in the preparation of smart membranes used in biosensing, drug delivery, and ionic circuit construction. Here we present a new concept for building synthetic nanopores that can simultaneously respond to pH and transmembrane potential changes. DNA oligomers containing protonatable A and C bases are attached at the narrow opening of an asymmetric nanopore. Lowering the pH to 5.5 causes the positively charged DNA molecules to bind to other strands with negative backbones, thereby creating an electrostatic mesh that closes the pore to unprecedentedly high resistances of several tens of gigaohms. At neutral pH values, voltage switching causes the isolated DNA strands to undergo nanomechanical movement, as seen by a reversible current modulation. We provide evidence that the pH-dependent reversible closing mechanism is robust and applicable for nanopores with opening diameters of up to 14 nm. The concept of creating an electrostatic mesh may also be applied to different organic polymers.