The best cure for banging water pipes is a water hammer arrester with a lubricated internal piston. The sealed piston works better than capped pipes, which eventually fill with water.
Water hammering is caused by the quick shutoff of water supply lines. The energy in flowing water has to go somewhere, and when a valve is shut off, the pipes can flex and “hammer” against anything close—like nearby studs, joists or other water pipes. Solenoid-triggered valves, like the ones in dishwashers, washing machines and water softeners, shut off almost instantly, not only causing the most ferocious hammering but also putting strain on rubber hoses and copper sweat fittings. Hand-controlled faucets usually don’t cause as much hammering because the shutoff is more gradual.
The traditional solution of adding a capped length of copper pipe (A) works by trapping a bubble of air that acts as a shock absorber for the back pressure, but it only works for a while. Eventually the air bubble shrinks because the air gets absorbed by the water until it disappears completely. Instead, install a manufactured water-hammer arrester (B and C), which is available at home centers. It isolates the pocket of air from the water in the pipes with a rubber-gasketed piston. The closer you locate the arrester to solenoid valves, the better. The model shown is designed to mount between the spigot and washing machine feed lines. If necessary, add more in-line arresters in other water pipes near faucets or valves to further reduce hammering.
Have the necessary tools for this DIY project lined up before you start—you’ll save time and frustration.
Avoid last-minute shopping trips by having all your materials ready ahead of time. Here's a list.