Banging noises coming from your pipes are commonly referred to as "water hammers," because they sound like someone is hitting your pipes with a hammer. Water hammers can have several different causes, ranging from problems with the faucet itself to problems with your home's water pressure.
A water hammer can be caused by faulty pieces in the faucet's plumbing system. A faulty washer in the faucet's hot water supply line valve, or one in the faucet itself, may cause water hammering if you shut off the hot water valve too quickly.
These problems can be complicated to repair, as they often involve taking the faucet or the valve apart and replacing the defective part with a new washer.
Another common source of water hammers comes when your faucet doesn't have an air chamber, or the air chamber it has is no longer functioning properly. When you turn your faucet on, the water flows from the water tank or water heater through the pipes and out the faucet nozzle.
When you turn the water off, there is a brief moment when the water is still flowing through the pipes but can no longer exit through the nozzle. Most faucets have an air gap, often an extra length of tubing or a coil, that allows the excess water to flow in after you shut the valve off.
If the air leaks out of the air gap, this may cause the water hammer. To address this problem, you need to drain the pipes of water, let air back into the system and then turn the water back on.
Banging pipe noises may also stem from loose pipes or problems with your water heater. For example, a water heater that is creating too much pressure may cause the water to back up forcefully and result in a water hammer even if you have a properly functioning air gap.
In other situations, the water momentum may cause your pipes to rattle in the walls as the water stops moving. This can happen when there are long sections of pipe or when a fastener holding the pipe still has come loose.