5. Given a cube $A B C D-A_{1} B_{1} C_{1} D_{1}$ with edge length 1, take point $M$ on the diagonal $A_{1} D$ and point $N$ on $C D_{1}$, such that the line segment $M N$ is parallel to the diagonal face $A_{1} A C C_{1}$. Then the minimum value of $M N$ is ( ).
(A) $\frac{\sqrt{3}}{3}$
(B) 1
(C) $\sqrt{2}$
(D) $\frac{\sqrt{2}}{2}$
5. A.

As shown in Figure 3, draw $M M_{1} \perp A D$ at point $M_{1}$, and draw $N N_{1} \perp D C$ at point $N_{1}$.
It is easy to prove that $M_{1} N_{1} \parallel A C$.
Let $D M_{1}=D N_{1}=x$. Then
$$
M M_{1}=x, N N_{1}=1-x \text {. }
$$

Draw $M H \perp N N_{1}$ at point $H$.
Thus, $N H=1-2 x, M_{1} N_{1}=\sqrt{2} x$.
By the Pythagorean theorem, we get
$$
\begin{array}{l}
M N^{2}=(\sqrt{2}-x)^{2}+(1-2 x)^{2} \\
=6\left(x-\frac{1}{3}\right)^{2}+\frac{1}{3} .
\end{array}
$$

When $x=\frac{1}{3}$, $M N$ reaches its minimum value $\frac{\sqrt{3}}{3}$.