How the surface integral of the electric displacement can be zero if we have a non-zero $D$ field? I was reading Griffiths' book on eletrodynamics and I came upon the integral form of Gauss' Law for $D$
$$
\oint \textbf{D} \cdot d\textbf{a} = Q_{free}
$$
Right ahead though he claims that we cannot determine exactly D only with the free charge density, citing an example where $\rho_f$ is zero but D itself is not zero. This confused me a little, is this really possible and won't it contradict Gauss' Law?
 A: Yes it is possible, for example if we have electrically neutral but electrically polarized body in vacuum/air. This has zero free charge density everywhere. But in general, $\mathbf D$ is non-zero both outside the body (because outside the body, $\mathbf D=\epsilon_0\mathbf E$ and polarized body has non-zero $\mathbf E$ outside) and if dielectric constantn $\epsilon_r$ of the body isn't zero, then also inside the body because there we have $\mathbf D = \epsilon_r\epsilon_0\mathbf E$ and polarized body usually has non-zero electric field inside as well.
Gauss's law only requires that
$$
\oint \mathbf D\cdot d\mathbf S = 0
$$
for any closed surface, or equivalently,
$$
\nabla\cdot \mathbf D =0
$$
at every point of space. In other words, $\mathbf D$ can be any solenoidal field.
A: The $Q_{free}$ in the right hand side of Gauss' law is the charge contained in the closed surface. You can very well have a field created by charges outside the integration surface. So the field going through the surface is not zero but overall the flux will be zero. This means that the flux of the field going inside the surface is equal to the flux of the field coming out of a surface.
The simplest case: a cubic surface in uniform field, with two of the faces perpendicular to the field. The field enters throuh one surface end exits through the opposite one. The other faces do not contribute to the flux. So total flux is zero even thouh the field is non-zero everywhere.
A: To picture how the electric displacement field $\mathbf{D}$ looks around a polarized object with polarization $\mathbf{P}$ and no free charge, simply picture how the magnetic field $\mathbf{B}$ looks around a magnetized object with magnetization $\mathbf{M}$ and no free currents. In this case, $\mathbf{D}$ will look exactly the same as $\mathbf{B}$.

Let me explain.
The answer by Ján Lalinský is correct. I just want to note an analogous magnetostatic situation happens for the $\mathbf{B}$ field, where $\mathbf{B}$ and $\mathbf{H}$ fields exist even though there is no free current, and thus $\nabla \times \mathbf{H} = 0$, but $\nabla\cdot\mathbf{H}\neq 0$.
We can make a perfect analogy between this and the electric displacement case with the transformations:

*

*$\mathbf{H} \rightarrow \mathbf{E}$ (a curl-free / irrotational field)

*$\mathbf{B} \rightarrow \mathbf{D}$ (a divergence-free / solenoidal field)

*$\mathbf{M} \rightarrow \mathbf{P}$ (a field whose divergence is proportional to the curl-free field, and whose curl is proportional to the divergence-free field).

Wikipedia has this nice picture:

So you can get a good picture of how it works from that. In this case, $\mathbf{H}$ as as a demagnetizing field similarly to how $\mathbf{E}$ acts as a depolarization field.
