In the Dwapara Yuga, a king named Chokkalingam came to this area for hunting and discovered a peculiar lotus flower in a tank. His men couldn't pick the flower as it started circling around the tank. The king shot an arrow at the flower, turning the water in the tank red. Realising it was a Shivalinga, he built a temple on the tank's bank. The place is known as Mouli Gramam, with "Mouli" meaning head or crown, and the lingam still bears a scar on its head.
It is also believed that Lord Shiva gave King Veerapandiyan a sacred bag of ash (Vibhuti), earning the name "Pokkalam Kodutha Nayanar."
The temple's Dwarapalakas (guards) of Lord Shiva are Thindi and Mundi. The place where Thindi worshipped Shiva is called Thindeeswaram (Thindivanam), and the place where Mundi worshipped the Lord is called Mundeeswaram.
Nandi’s History :-
Nandanar was born into a family that made leather for drums. Because of his profession, he was not allowed to enter temples. His dream was to visit the temple at Chidambaram. He worked for a landlord who wouldn't let him go to the temple. One day, the landlord promised Nandanar that he could visit the temple if he could plough forty acres of paddy fields overnight. Nandanar was sad but prayed to Lord Shiva for help. Miraculously, the fields were ploughed overnight. The next morning, the landlord was astonished and realised his mistake, asking for forgiveness.
Nandanar then set out for Chidambaram. On the way, he stopped at Thirupungur to see Lord Shiva but couldn't because Nandi, Shiva's bull, was blocking his view. He sang in praise of Lord Shiva. Shiva, pleased with Nandanar's devotion, asked Nandi to move aside so Nandanar could have a clear view. At this temple, you can see Nandi is moved to the side and isn't sticking out his tongue as usual. The temple guards (dwarapalakas) are also depicted craning their necks as if listening to Lord Shiva's command.