The noisy pipes after a toilet flushes are basically shock waves travelling through the pipes. There are fixes to this problem, either at the toilet or at the pipes.
The term for these "banging pipes" is water hammer. This banging is caused by a water valve that closes too quickly. This brings the flowing water inside the pipe to a screeching halt.
The noisy pipes may occur because the toilet fill valve allows water into the tank too quickly, then suddenly shuts off when the water level reaches the right point. This water pressure can be lowered by adjusting the shut-off valve, turning it to the right to lower the speed at which the water enters the tank.
An air chamber, which is a section of pipe that is capped on the end, can be installed to the toilet's supply line near the shut-off valve. Trapped air in the air chamber acts as a cushion for the shock of quick-stopping water inside the pipe. Or, a water hammer arrester can be installed on the pipe near the toilet. It acts as a shock absorber and cushions the banging, preventing the effects of water hammer.