I certainly recommend trying all of the easy fixes, but I’ve had this problem several times on my mid-2012 15” Pro, and each time it was the DC-in board.
I believe the way to tell if it’s the board is when your battery power icon starts acting up. For example, the icon will say you have a 70% charge, but when you momentarily unplug the Magsafe, oops, now it says you have a 45% charge, indicating that something is going on with the board, and it’s simply not sending the proper information to the rest of the computer anymore. Also you can have a situation where the green light lites up, but doesn’t want to switch to orange. Having to wiggle the Magsafe to get it to charge is also a bad sign, and logically would seem to indicate that the problem is mechanical, but you may still need a DC-in board even if all the visible parts look secure. Weird activity with the charging icon is what ultimately tells the tale in my experience.
Where exactly the heat comes from in this situation is hard to say, I suspect the input board is no longer properly regulating the rate at which the power is fed into the computer, as I’ve had this same problem when all the pins and contacts look perfectly clean and bright. For the time being that is, until they start looking cooked, and the plastic starts melting around the pins.
Holding an ice cube on the Magsafe can be an emergency measure if you have the patience for it. The closer you get to a 100% charge, the cooler the Magsafe will run. But once you get to an indicated 100%, everything can seem fine, until you momentarily disconnect the Magsafe, and suddenly it says you’re down to an 80% charge again.
I also suspect that some of the DC-in boards you can get may be counterfeit, and may not hold up as well as the original factory boards, although who can say, as it was the factory board that messed up in the first place.