Survival requires that living organisms continuously monitor environmental and tissue pH. Animals sense acidic pH using ion channels and G-protein-coupled receptors (GPCRs), but monitoring of alkaline pH is not well understood. We report here that in the nematode Caenorhabditis elegans, a transmembrane receptor-type guanylyl cyclase (RGC), GCY-14, of the ASEL gustatory neuron, plays an essential role in the sensing of extracellular alkalinity. Activation of GCY-14 opens a cGMP-gated cation channel encoded by tax-2 and tax-4, resulting in Ca2+ entry into ASEL. Ectopic expression of GCY-14 in other neurons indicates that it accounts for the alkalinity sensing capability. Domain-swapping and site-directed mutagenesis of GCY-14 reveal that GCY-14 functions as a homodimer, in which histidine of the extracellular domains plays a crucial role in alkalinity detection. These results argue that in addition to ion channels and GPCRs, RGCs also play a role in pH sensation in neurons.