How to stop banging or rattling
“Waterhammer” occurs when water flow is abruptly cut off by a valve, causing the pipes to vibrate and bang. To prevent it, install shock-absorbing air chambers atop the pipes that lead to your fixtures. An air chamber can be a capped length of pipe, a coil of tubing, or a sealed chamber containing a flexible diaphragm. The first two may eventually fill with water, and hammering will resume. In that case, drain the plumbing system to readmit air to the chamber.
Another type of pipe noise can result from a loose pipe banging on a wall stud or a basement beam when water is turned on or off. Secure the pipe with a U-shaped strap cushioned with a piece of rubber-not too tight on a hot water pipe, which must expand and contract.
Water hammer is common with washers and dishwashers that have automatic valves that turn water on and off quickly. To end it, have an air chamber installed between the valve and the pipes. Sometimes a loose washer causes rattling.
Turn off the watersupply, remove the faucet housing, and tighten or replace the washer.