Hanuman's mother Anjana had told him that all ripe fruits would form his food. One day, when young Hanuman saw the bright yellow sun he thought it to be a ripe fruit and wanted to eat it. He leaped after the sun and put it in his mouth.
When Indra saw Hanuman gobbling the sun, he became anxious. Without the sun, the universe would cease to function.
He soon hurled the vajra or thunderbolt and injured the flying Hanumann on his cheek. Hanuman fell unconscious. His father, Vayu, the wind god became very angry at Indra's act and withdrew from the universe.
Once the wind was gone, all living creatures withered and began losing their life. To pacify Vayu, Indra lifted his thunderbolt and Hanuman recovered.
From then on, he became known as Hanuman since hanu in Sanskrit means 'cheek'.