3. For the hyperbola $\frac{x^{2}}{a^{2}}-\frac{y^{2}}{b^{2}}=1$, one of its asymptotes intersects the parabola $y=x^{2}+1$ at only one point. Then the eccentricity of the hyperbola is ( ).
(A) $\frac{5}{4}$
(B) 5
(C) $\frac{\sqrt{5}}{2}$
(D) $\sqrt{5}$
3. D.

From the problem, we know that the asymptotes of the hyperbola are $y= \pm \frac{b}{a} x$. By combining and simplifying with the parabola, we get
$$
a x^{2} \pm b x+a=0 \text {. }
$$

Let $\Delta=0$, solving gives $b^{2}=4 a^{2} \Rightarrow b=2 a$.
Thus, the eccentricity of the hyperbola is
$$
e=\frac{c}{a}=\frac{\sqrt{b^{2}+a^{2}}}{a}=\sqrt{5} \text {. }
$$