6. If the real number $x$ satisfies $||x^{2}-4 x-5|-6|=a$ and there are exactly 6 values of $x$, then the range of the real number $a$ is ( ).
(A) $-6 \leqslant a \leqslant 0$
(B) $0<a \leqslant 3$
(C) $3<a<6$
(D) $6 \leqslant a<9$
6.C.

Sketch the graph of the function $y=|| x^{2}-4 x-5|-6|$, and observe the number of intersection points between the line $y=a$ and the graph to determine the range of the real number $a$ is $3<a<6$.