A.The usual cause of the banging in domestic hot water pipes is water hammer. When the pipe full of water is running, there is a considerable momentum from the mass of water in motion. When the flow is suddenly stopped, such as when a solenoid valve on a washer or dishwasher closes, or when a faucet is turned off quickly, this energy of the moving water is transferred to the pipe, causing it to vibrate and move enough to hit the framing.
Plumbers often take off the supply from a tee, and add a short length of capped pipe above the tee to serve as a shock absorber. This works as long as air remains in the capped pipe. When the air chamber becomes waterlogged, the system has to be drained down to replenish the air. Since air dissolves readily in hot water, however, you may have to...
to read the full article.