If water pipes bang loudly when a faucet is shut off, it may be due to a condition known as water hammering. Besides the annoying noise, water hammering can damage the plumbing system and the valves on appliances. You can stop this problem by locating the source of the noise and following these steps to correct the situation.
Find the location of the noise by having someone turn the faucet on and off while you follow the sound to its source.
Determine whether the noise is produced by loose pipes in the basement or the crawl space under the house. This is a common problem. The solution is to strap down loose pipes with plumber's tape (a galvanized metal strap), cushion them with rubber blankets, or both.
Drain the water system's air chambers if you don't find loose pipes or if measures taken in Step 2 do not solve the problem. Air chambers are short lengths of pipe, capped at one end and installed vertically in the walls behind fixtures and appliances, designed to use air to cushion the water when the flow is turned off quickly. These chambers can become filled with water over time, which reduces their effectiveness. They can usually be restored by turning off the water supply at the main supply line, opening the lowest faucet in the system (usually at an outside hose bib) and draining the system completely.
Replace a faulty air chamber by opening the wall and installing a new air chamber. If you don't want to put holes in the wall, you can build and install a retrofit air chamber on the line that comes outside the wall behind an appliance, such as a toilet tank, dishwasher or a washing machine, three common places where water hammering occurs. See Resources below for instructions on making and installing a retrofit air chamber.
Consider excess water pressure coming in through the main line. Most newer houses have a regulator that keeps the pressure entering the house at 80 pounds per square inch (psi) or less. If the water pressure exceeds the 80 psi, you may need to have a licensed plumber install a new regulator.
Don't use galvanized straps on copper pipes. The two dissimilar metals causes electrolysis that will break down the metal. If you need to strap copper pipes, be sure to use thick rubber blankets over the copper before installing new straps.