Head banging

My son is 15 months and banging his head on everything suddenly on purpose. The cabinets, walls, crib, anything hard. If hes laying down or sitting in his high chair he will start smacking the top of his head with his hands. We have tried ignoring, telling him no and to be gentle and dont hurt yourself, and now we are onto scolding because hes hitting himself so hard hes leaving bruises all over his head and beautiful face. I'm so frustrated, I hate seeing him hurt himself what else can I do?