Let me start by saying I'm 100% sure it is not an STD.

For as long as I've been masturbating I periodically get a sharp burning pain in the tip of my penis that sometimes even continues down the shaft. It feels like you always have to pee but you really cant. Taking a piss is great temporary relief but as soon as you finish it comes right back.

This only occurs once every month or so, generally following ejaculation by about 5-10 minutes. The burning can last from 30 minutes to a few hours.

I would like to know what causes this/what is happening but more importantly I'd like to be able to resolve the pain.