In the earliest legend, Dehradun was a part of Kedarkhand, the abode of Great God Shiva whose popularity in this region is reflected in the hills being called after Him as Shiwalik. The place also figures in two mythological epics Mahabharata & Ramayana. It is said that Rama and his brother Lakshmana came here to do the penance after the death of Ravana at their hands. Five Pandava brothers also sojourned here while on their way to inner recesses of Himalayas.
Another legend is connected with a little river called Suswa. After Indra made fun of 60000 pygmy brahmins for trying vainly to cross the vast lake formed by the footprint of cow filled with water. They prayed here by doing penance and mortification to create an alternate Indra who will be superior to the existing Indra. Their sweat resulted into this river and alarmed Indra. He appeased their wrath through good offices of Brahma.
Then there is a legend of Snake, Bamun, who became the Lord of Dun on the summit of Nagdish hill. This legend seems to point to the Naga supermacy on one time. The famous stone at Kalsi near Haripur on the right banbearing the Edict of emperor Asoka may mark the boundary on Northern side.