The temple is dedicated to Shiva who stands enshrined in a
cave in the form of a 'lingam'.
THE LEGEND OF DHANKIA MAHADEVA TEMPLE
According to the local legend a Brahmana had a goat which gave him a huge quantity of milk daily. Once the goat disappeared beyond the mountains overlooking the Satluj River and was not traceable despite all efforts made to do so.
Shiva is said to have appeared to a Brahamana in a dream told him that the goat had been bathing him with its milk in an inaccessible cave and was advised to visit the cave to find his lost animal.
The Brahmana not only discovered his lost goat in the cave but also a lingam enshrined there in. Thereafter he dedicated his life to Shiva and spent the rest of his life there with the goat.