6. Given $f(x)=\sqrt{a x^{2}+2 b x}$, there exists at least one positive number $b$, such that the domain and range of $f(x)$ are the same. Then the value of the real number $a$ that satisfies the condition is $\qquad$ .
6.0 or 4.

If $a=0$, then for each positive number $b, f(x)=\sqrt{b x}$ has a domain and range of non-negative real numbers. Thus, $a=0$ satisfies the condition.

If $a>0$, then for any positive number $b, f(x)=\sqrt{a x^{2}+2 b x}$ has the domain
$$
D=\left(-\infty,-\frac{2 b}{a}\right] \cup[0,+\infty) .
$$

And the range of $f(x)=\sqrt{a x^{2}+b x}$ is $A \subseteq[0,+\infty)$, so, $D \neq A$, which means $a>0$ does not satisfy the condition.

If $a<0$, then for any positive number $b, f(x)=\sqrt{a x^{2}+2 b x}$ has the domain $D=\left[0,-\frac{2 b}{a}\right]$, at this time,
$$
f(x)_{\max }=f\left(-\frac{b}{a}\right)=\frac{b}{\sqrt{-a}},
$$

Thus, the range of $f(x)=\sqrt{a x^{2}+2 b x}$ is $\left[0, \frac{b}{\sqrt{-a}}\right]$.
Therefore, $-\frac{2 b}{a}=\frac{b}{\sqrt{-a}} \Leftrightarrow a=-4$.
In summary, the value of $a$ is 0 or -4.