Corresponding frequency domain filter of spatial domain filter in image processing?
So, the $M\times N$-DFT is very well-defined to be (aside from the usual ambiguity about the factor up front)

$$
X[k,l] = \frac{1}{\sqrt{MN}}\sum_{n=0}^{N-1} \left(\sum_{m=0}^{M-1}x[m,n]\cdot e^{-jmk\frac{2\pi}{M}}\right)e^{-jnl\frac{2\pi}{N}}
$$

In your $M=N=3$ case, that becomes

$$
X[k,l] = \frac{1}{3}\sum_{n=0}^{2} \left(\sum_{m=0}^{2}x[m,n]\cdot e^{-jmk\frac{2\pi}{3}}\right)e^{-jnl\frac{2\pi}{3}} \tag1
$$

Furthermore, 

$$ x = \begin{bmatrix}
0 &amp; 1&amp; 0 \\
1&amp; 0 &amp; 1\\
0 &amp; 1&amp;0 \\
\end{bmatrix} $$

so that all there's a lot of zeros. 

Simply expand the sum from $(1)$, filling in the values of $x$.

$$\begin{array}
\,3X[k,l]&amp;=&amp; &amp;\left(e^{-jk\frac{2\pi}3}\right)e^{j0} &amp; \text{first row}\\
&amp;&amp; +&amp; \left(e^{-j0}+e^{-jk\frac{4\pi}3}\right)e^{-jl\frac{2\pi}3}&amp; \text{second row}\\
&amp;&amp;+ &amp;\left(e^{-jk\frac{2\pi}3}\right)e^{-jl\frac{4\pi}3}&amp;\text{third row}\\
&amp;=&amp;&amp;e^{-jk\frac{2\pi}3}\\
&amp;&amp;+&amp;e^{-jl\frac{2\pi}3} + e^{-j\frac{2\pi}3\left(l-2k\right)}\\
&amp;&amp;+&amp;e^{-j\frac{2\pi}3\left(k-2l\right)}
\end{array}$$

So,

$$X[k,l]=\frac13\left(e^{-jk\frac{2\pi}3}+e^{-jl\frac{2\pi}3} + e^{-j\frac{2\pi}3\left(l-2k\right)}+e^{-j\frac{2\pi}3\left(k-2l\right)}\right)$$

Set in all values for $k$ and $l$, and get your $3\times3$ DFT output .