Heat regulation is a complex intrinsic internal bodily activity associated with the nervous system.
Heat is primarily detected by dermal thermoreceptors, which link to cranial and spinal nerves and travel to the associated brain areas via the spinal-thalamic pathway on the contralateral side of the spinal cord. The primary target of thermoreception signals is the hypothalamus, a brain structure responsible for most overall visceral regulation.
The anterior nucleus of the medial area of the hypothalamus is responsible for panting and shivering responses. Along with recieving information from thermoreceptors on the skin, the anterior nucleus is continual with the 3rd ventricle. The temperature of the ventricle helps determine the temperature at which the hypothalamus will set the body via painting/shivering.
Fever is also a common bodily response to pathological microbiological infection, most often bacteria, and not often viruses. By increasing core body temperature, the body hopes to increase activity of certain necessary enzymes that are optimally active at higher temperatures, and to make a thermal environment not conducive for bacterial replication.