8. In the rectangular prism $A B C D-A_{1} B_{1} C_{1} D_{1}$, it is known that $A B=$ $A A_{1}=4, A D=3$. Then the distance between the skew lines $A_{1} D$ and $B_{1} D_{1}$ is $\qquad$
8. $\frac{6 \sqrt{34}}{17}$.

From $B_{1} D_{1} / / B D$, we know $B_{1} D_{1} / /$ plane $A_{1} B D$. Therefore, the distance from line $B_{1} D_{1}$ to $A_{1} D$ is equal to the distance from $B_{1} D_{1}$ to plane $A_{1} B D$, denoted as $h$.
Given that $A_{1} D=B D=5, A_{1} B=4 \sqrt{2}$. Then
Thus, $h=\frac{6 \sqrt{34}}{17}$.