Green’s Dictionary of Slang

headbang v.

to shake one’s head violently when watching or listening to heavy-metal music; thus headbanging music.

[Ire]R. Doyle Commitments 100: Two heavy metallers were leaning against the wall at the side. [...] They started to headbang.
[US]M. Myers et al. Wayne’s World II [film script] The camera pulls back to reveal thousands headbanging to Aerosmith’s song.