hot water pipes rattle when hot water is turned off

We just moved into our townhouse (not new; built in '97) and have discovered that the hot water pipes bang briefly when the hot water is turned off. This doesn't happen when the cold water is turned off. Our house is two story and my husband says it seems that the noise is originating in the guest bathroom upstairs. Would appreciate any feedback
Thanks
MC
  3 answers
Your comment...