Organisms must coordinate behavioral and physiological responses to changingenvironmental conditions. In the nematode C. elegans, the presence or absence of foodin the environment affects many metabolic and behavioral responses, including fathomeostasis, lifespan, and male mating. Specifically, male mating behavior normallyoccurs when a well-nourished male encounters a hermaphrodite, and is repressed if themale is under-nourished. To understand how environmental changes influence the driveto carry out specific behavioral tasks, I used C. elegans male mating as a model.Previously, mutants were isolated that display male mating behavior at inappropriatetimes, i.e. in the absence of mating cues. Loss of function mutations in the ERG K+channel, UNC-103, results in spontaneous seizures of the male sex muscles.Interestingly, I found that food deprivation can suppress unc-103(lf)-induced seizures,suggesting that pathways activated under this environmental condition can suppress theexcitability of the mating circuit.Using molecular, genetic, and behavioral assays, I identified sensory andmolecular mechanisms that reduce sex-muscle excitability under food-deprived conditions. I found that mutations that affect the muscular feeding organ, the pharynx,phenocopy the effects of food deprivation, and reduce sex-muscle excitability. Idemonstrated that mutations in the pharyngeal muscle protein, tropomyosin, cause thepharyngeal neurosecretory motor neurons (NSMs) to increase pharyngeal excitabilityand reduce sex-muscle excitability. Additionally, I found that olfactory neurons (AWCs)with sensory cilia exposed to the environment are up-regulated in the absence of foodstimuli, and also send inhibitory signals to the sex muscles. To determine howchemosensory and pharyngeal neurons in the head can signal to the genitalia, Ihypothesized that one mechanism could be via secretion of metabolic hormones. To testthis, I examined loss-of-function mutations in the insulin-like receptor, DAF-2, which isknown to regulate many behavioral and physiological responses to food. I demonstratedthat DAF-2 activity in the sex muscles is required for food-deprivation suppression ofunc-103(0)-induced seizures. I then identified components of a novel-insulin-like/DAF-2signaling pathway that reduces excitability. Specifically, I propose that ligand binding toDAF-2 activates PLC- and leads to increased cystolic Ca2+. This Ca2+ influx activatesCaMKII, which can phosphorylate/activate EAG-like K+ channels, thereby reducing cellexcitability.