Steam is rumbling through the hot water system as it moves ahead of the hot water causing the pipe causing to expand and knock against the wall or other pipes. This happens more often in older buildings where the pipes are not insulated or anchored properly.
you have trapped air in your pipes. the knocking sound is the pipes shaking back and forth beneath the house. You can flush the air yourself or hire a plumber
Reasons for knocking in your hor water pipe could be:air must be catching in between, check inlet pipe connection to hot water system, check the pipe, balance outlet pipe from hot water system.