2. The function $f(x)=-\log _{\frac{1}{2}}\left(x^{2}-a x-a\right)$ is decreasing on the interval $(-\infty, 1-\sqrt{3})$. Then the range of values for $a$ is ( ).
(A) $0 \leqslant a \leqslant 2$
(B) $2(1-\sqrt{3}) \leqslant a \leqslant 2$
(C) $0 \leqslant a \leqslant 2$ or $a \leqslant-4$
(D) $2(1-\sqrt{3}) \leqslant a \leqslant 2$ or $a \leqslant-4$
2. (B).
$$
y=-\log _{\frac{1}{2}}\left(x^{2}-a x-a\right)=\log _{2}\left(x^{2}-a x-a\right) .
$$

To make $y=\log _{2}\left(x^{2}-a x-a\right)$ a decreasing function on the interval $(-\infty, 1-\sqrt{3})$, it is sufficient that the domain of the function includes $(-\infty, 1-\sqrt{3})$, and that $y^{*}=x^{2}-a x-a$ is a decreasing function on $(-\infty, 1-\sqrt{3})$. The latter condition is $1-\sqrt{3} \leqslant \frac{a}{2}$.
Thus, $a \geqslant 2(1-\sqrt{3})$.
The discriminant of $x^{2}-a x-a$ is $\Delta=a^{2}+4 a$.
(1) When $-4 < a < 0$, the function $y^{*}=x^{2}-a x-a$ has no real roots, and it is always positive.
(2) When $a \geqslant 0$, the function $y^{*}=x^{2}-a x-a$ has real roots, and the roots are $x_{1,2}=\frac{a}{2} \pm \sqrt{a+\frac{a^{2}}{4}}$.

It contains the interval $(-\infty, 1-\sqrt{3})$.
Thus, $1-\sqrt{3} \leqslant \frac{a}{2}-\sqrt{a+\frac{a^{2}}{4}}$.

Solving this, we get $a \leqslant 2$. Combining with (1), we get $0 \leqslant a \leqslant 2$.
In summary, $2(1-\sqrt{3}) \leqslant a \leqslant 2$.