2. Let $x, y \in \mathbf{R}$, the complex numbers $z_{1}=x+1+y \mathrm{i}$ and $z_{2}$ $=x+(y+1) \mathrm{i}$ have a sum of their magnitudes equal to 2. Then the range of $x^{2}+y^{2}$ is ( ).
(A) $[0, \sqrt{2}]$
(B) $[0,2]$
(C) $[0, \sqrt{3}]$
(D) $[0,3]$
2. B.

From the conditions of the problem, the locus of point $(x, y)$ is an ellipse with foci at $F_{1}(-1,0)$ and $F_{2}(0,-1)$, and this ellipse passes through the origin $O$. The problem requires finding the maximum distance from a moving point $(x, y)$ on the ellipse to the origin $O$ (the minimum distance is 0), which is equivalent to finding the maximum distance from a moving point $(x, y)=\left(\cos \theta, \frac{\sqrt{2}}{2} \sin \theta\right)$ on the ellipse $x^{2}+2 y^{2}=1$ to the point $A\left(0, \frac{\sqrt{2}}{2}\right)$ (as shown in Figure 4).
The square of the distance from the point $\left(\cos \theta, \frac{\sqrt{2}}{2} \sin \theta\right)$ to $A$ is
$$
\begin{array}{l}
\cos ^{2} \theta+\left(\frac{\sqrt{2}}{2} \sin \theta-\frac{\sqrt{2}}{2}\right)^{2} \\
=2-\frac{1}{2}(1+\sin \theta)^{2} \leqslant 2 .
\end{array}
$$

When $\sin \theta=-1$, the equality holds.
Therefore, the range of $x^{2}+y^{2}$ is $[0,2]$.