Animals assess food availability in their environment by sensory perception and respond to the absence of food by changing hormone and neurotransmitter signals. However, it is largely unknown how the absence of food is perceived at the level of functional neurocircuitry. In Caenorhabditis elegans, octopamine is released from the RIC neurons in the absence of food and activates the cyclic AMP response element binding protein in the cholinergic SIA neurons. In contrast, dopamine is released from dopaminergic neurons only in the presence of food. Here, we show that dopamine suppresses octopamine signalling through two D2-like dopamine receptors and the G protein Gi/o. The D2-like receptors work in both the octopaminergic neurons and the octopamine-responding SIA neurons, suggesting that dopamine suppresses octopamine release as well as octopamine-mediated downstream signalling. Our results show that C. elegans detects the absence of food by using a small neural circuit composed of three neuron types in which octopaminergic signalling is activated by the cessation of dopamine signalling.