6. The domain of the function $y=\sqrt{5-4 x-x^{2}}+\log _{\frac{1}{2}}(\cos 2 x+$ $\sin x-1)$ is ( ).
(A) $\left(0, \frac{1}{2}\right)$
(B) $\left[-5,-\frac{7 \pi}{6}\right) \cup\left(0, \frac{\pi}{6}\right)$
(C) $\left(0, \frac{\pi}{6}\right)$
(D) $\left(-\frac{7 \pi}{6},-\pi\right) \cup\left(0, \frac{\pi}{6}\right)$
6.D.

From the problem, we have $\left\{\begin{array}{l}5-4 x-x^{2} \geqslant 0, \\ \cos 2 x+\sin x-1>0 .\end{array}\right.$
Therefore, $\left\{\begin{array}{l}-5 \leqslant x \leqslant 1, \\ 0<\sin x<\frac{1}{2} .\end{array}\right.$
Thus, $\left\{\begin{array}{l}-5 \leqslant x \leqslant 1, \\ 2 k \pi<x<2 k \pi+\frac{\pi}{6} \text { or } 2 k \pi+\frac{5 \pi}{6}<x<2 k \pi+\pi(k \in \mathbf{Z}) .\end{array}\right.$ Taking the intersection yields the solution.