When food is plentiful, circadian rhythms of animals are powerfully entrained by the light-dark cycle. However, if animals have access to food only during their normal sleep cycle, they will shift most of their circadian rhythms to match the food availability. We studied the basis for entrainment of circadian rhythms by food and light in mice with targeted disruption of the clock gene Bmal1, which lack circadian rhythmicity. Injection of a viral vector containing the Bmal1 gene into the suprachiasmatic nuclei of the hypothalamus restored light-entrainable, but not food-entrainable, circadian rhythms. In contrast, restoration of the Bmal1 gene only in the dorsomedial hypothalamic nucleus restored the ability of animals to entrain to food but not to light. These results demonstrate that the dorsomedial hypothalamus contains a Bmal1-based oscillator that can drive food entrainment of circadian rhythms.