“You know I’ve had a name rattling around in my head?”
“Is that what makes the noise?”
“I’ll ignore that."
I couldn't understand the last two sentences. Is it an idiom?
No. The second speaker is jokingly suggesting that a noise is coming from the first speaker's head. The first speaker understands the humour, but says that s/he is not going to be drawn into defending his/her original choice of words.