May be but type in your search engine box 'causes of hammering water pipes' Pick the Wikipedia one it makes interesting reading on water hammering, causes and cures. Mean time flush the toilet watch the float on the cistern see if it's 'jumping'. A washer change may cure it, other than that it may require a valve change completely.
Bob
May 2013