It is popping because there are rust or calcium nodes on the flue pipe through the heater. Water gets into the node and the heat from the exhaust gases turns them to steam. The bang is the steam changing back to water when pressure forces it out of the node. Vinegr will not cure it and anything stronger may damage the tank or you.
Thank you for your reply. I recently put in a water softner to take care of the hardwater we have. What can I do about the water heater? Can it be fixed?