# 阻擋網頁功能-2

### 阻擋網頁功能-2

方法1如果失敗嘗試用方法2，方法1可能阻擋網頁有多個對外IP，可能就會失效。

- \*\*重導向DNS到 防火牆本身
- 利用防火牆DNS做阻擋。
- 或利用 PFBLOCK套件阻擋。

### 重導向DNS到 防火牆本身

讓CLIENT端查詢DNS 只能用防火牆IP

參考[原廠說明](https://docs.netgate.com/pfsense/en/latest/recipes/dns-redirect.html)

到 Firewall \\ NAT \\ Port Forward 建立規則

[![image.png](https://books.cpic.com.tw/uploads/images/gallery/2023-06/scaled-1680-/Xsximage.png)](https://books.cpic.com.tw/uploads/images/gallery/2023-06/Xsximage.png)

### 利用防火牆DNS做阻擋

到 Services \\ DNS Resolver 最底下 Host Overrides 新增主機

IP ADDRESS 隨意輸入

[![image.png](https://books.cpic.com.tw/uploads/images/gallery/2023-06/scaled-1680-/rUaimage.png)](https://books.cpic.com.tw/uploads/images/gallery/2023-06/rUaimage.png)