How to Disable Unbound DNS Resolver on PfSense to Use Encrypted DoH Exclusively

Direct Answer
To disable the Unbound DNS resolver on pfSense and use encrypted DoH exclusively, navigate to Services > DNS Resolver and uncheck the "Enable" box.
In the context of modern network security, transitioning to encrypted DNS over HTTPS (DoH) is crucial for safeguarding user privacy and ensuring data integrity. Disabling the Unbound DNS resolver on pfSense, a widely-used open-source firewall and router software, allows network administrators to leverage the enhanced security features of DoH, effectively encrypting DNS traffic and protecting it from potential interception or manipulation. This process involves configuring pfSense to bypass its default DNS resolution mechanism, Unbound, which operates as a caching and recursive DNS resolver. By exclusively adopting DoH, administrators can ensure that DNS queries are encrypted and transmitted over HTTPS, thereby mitigating risks associated with DNS spoofing and man-in-the-middle attacks. This transition requires careful configuration changes within the pfSense interface, ensuring that all DNS requests are routed through a DoH-compatible service, thus enhancing the overall security posture of the network infrastructure. This guide provides a comprehensive walkthrough for IT professionals seeking to implement this change, emphasizing the importance of maintaining robust network security standards in an increasingly digital world.
Understanding the Role of Unbound DNS in pfSense Architecture
The Unbound DNS Resolver is a critical component within the pfSense architecture, serving as the default domain name resolution service. It operates as a caching DNS resolver, which means it directly queries authoritative DNS servers to resolve domain names into IP addresses, storing these results temporarily to expedite future requests.
In pfSense, Unbound is configured to run in a recursive mode by default, allowing it to independently resolve DNS queries without relying on upstream DNS providers. This configuration enhances privacy and control, as it eliminates the need to trust external DNS servers with query data.
Unbound's integration with pfSense is seamless, utilizing a web-based GUI for configuration, which provides users with an intuitive interface to manage DNS settings. This integration allows administrators to configure DNS over TLS (DoT) and DNS over HTTPS (DoH) options, though the latter requires additional configuration.
Unbound supports advanced DNS features such as DNSSEC validation, which ensures the authenticity of DNS responses, protecting against cache poisoning and other attacks. It is also capable of handling DNS forwarding, allowing specific queries to be directed to designated upstream DNS servers for resolution.
Within the pfSense system, Unbound is typically managed through the "Services" menu, where administrators can access the "DNS Resolver" settings to enable or disable specific features. The service can be started, stopped, or restarted from this interface, providing flexibility in managing DNS operations.
To disable Unbound DNS Resolver in pfSense, navigate to Services
> DNS Resolver. Here, the "Enable DNS Resolver" checkbox controls the activation of the service, and unchecking this box will disable Unbound.Disabling Unbound is often a precursor to configuring an alternative DNS resolution method, such as DNS over HTTPS (DoH), which encrypts DNS queries to enhance privacy and security. This transition requires careful planning to ensure that DNS services remain uninterrupted and that all necessary configurations are in place for the new DNS method.
Unbound's role extends beyond basic DNS resolution; it also supports features like host overrides, which allow specific DNS queries to be resolved to predefined IP addresses. This feature is particularly useful in environments where internal DNS resolution is necessary for certain hostnames.
For environments requiring high availability, Unbound can be configured to work with pfSense's High Availability (HA) setup, ensuring DNS resolution is maintained across failover events. This setup involves synchronizing DNS settings between pfSense instances to provide continuous service availability.
In summary, Unbound DNS Resolver is a versatile and integral part of the pfSense architecture, providing robust DNS resolution capabilities with options for enhanced privacy and security. Understanding its role and configuration is essential for network engineers managing pfSense deployments, especially when transitioning to encrypted DNS solutions like DoH.

Configuring pfSense to Disable Unbound DNS Resolver Services
To configure pfSense to disable the Unbound DNS Resolver services and enable exclusive use of encrypted DNS over HTTPS (DoH), the administrator must first access the pfSense web interface. Begin by logging into the pfSense dashboard using the appropriate administrative credentials and ensure that the system is up to date with the latest firmware and security patches to avoid potential vulnerabilities.
Navigate to the Services
menu and select DNS Resolver from the dropdown list. This section contains the configuration settings for the Unbound DNS Resolver, which is the default DNS service in pfSense. The administrator must deselect the Enable checkbox to disable the Unbound service, ensuring that the pfSense firewall will not use it for DNS resolution.Once the Unbound service is disabled, scroll down to the DNS Resolver Configuration
section and review any advanced settings that might interfere with the transition to DoH. Pay particular attention to custom options or overrides that might still be active, as these can cause conflicts when switching to an alternative DNS service.After verifying and adjusting the advanced settings, click the Save
Next, proceed to configure the pfSense system to utilize encrypted DNS over HTTPS. Navigate to System
and then General Setup to specify the DNS servers that support DoH. Enter the IP addresses of the desired DoH providers in the DNS Server fields, ensuring that each entry is accompanied by the correct gateway association if necessary.To implement DoH, the administrator must install an appropriate package that facilitates encrypted DNS queries. Navigate to System
and select Package Manager, then browse the available packages to locate a suitable DoH client, such as cloudflared or dnscrypt-proxy. After selecting the desired package, click Install and follow the on-screen instructions to complete the installation process.Once the DoH client is installed, further configuration is required to ensure seamless integration with pfSense. Access the installed package's configuration page from the Services
menu, and input the necessary parameters to establish a secure connection to the DoH provider. This typically involves entering the DoH endpoint URL, selecting the appropriate encryption settings, and specifying any additional options required by the provider.After configuring the DoH client, test the setup to ensure that DNS queries are correctly routed through the encrypted channel. This can be accomplished by using diagnostic tools available within pfSense, such as the DNS Lookup
feature under Diagnostics. Perform a lookup for a known domain and verify that the response is received from the configured DoH provider.To further validate the configuration, utilize external tools to confirm that DNS queries are encrypted and not leaking to other DNS services. Online privacy test websites can provide insights into the DNS resolution path and verify that the queries are securely tunneled through DoH. If any issues are detected, revisit the DoH client configuration and adjust the settings as necessary to ensure compliance with security and privacy requirements.
Finally, monitor the pfSense system logs to identify any anomalies or errors related to DNS resolution. Access the Status
menu and select System Logs, then filter the logs by DNS to review relevant entries. Continuous monitoring will help ensure that the transition to exclusive DoH usage is stable and that the network remains secure from DNS-based attacks.| Parameter | Unbound DNS Resolver | Encrypted DoH (DNS over HTTPS) | Impact on PfSense |
|---|---|---|---|
| Configuration Complexity | Low - Integrated GUI setup | Moderate - Requires additional packages and configuration | Transition requires disabling Unbound and configuring DoH client |
| Performance | High - Local caching and fast resolution | Variable - Depends on external DoH server response times | Potential latency increase due to external querying |
| Security | Standard DNS - Vulnerable to MITM attacks | High - Encrypted traffic prevents eavesdropping | Improved security with encrypted DNS queries |
| Resource Utilization | Low - Minimal CPU and memory usage | Moderate - Additional overhead for encryption | Increased CPU usage due to encryption processes |
| Privacy | Low - Queries visible to ISPs or network operators | High - Queries encrypted, enhancing privacy | Enhanced privacy with encrypted DNS queries |
Para entender mais detalhes, leia o artigo completo sobre configuração recomendada no blog
.Implementing Secure DNS Over HTTPS (DoH) Protocol on pfSense
To implement DNS over HTTPS (DoH) on pfSense, it is essential first to disable the default DNS resolver, Unbound, and configure the system to utilize DoH for secure DNS queries. This process involves accessing the pfSense web interface, modifying DNS settings, and ensuring that the system routes DNS traffic exclusively through a DoH provider. It is crucial to follow each step meticulously to maintain network security and integrity.
Step 1: Accessing the pfSense Web Interface
Begin by logging into the pfSense web interface using a web browser. Navigate to the login page by entering the IP address of the pfSense firewall in the browser's address bar. Enter the administrator credentials to access the dashboard, ensuring that you have sufficient privileges to make changes to the DNS configuration.
Step 2: Disabling the Unbound DNS Resolver
Once logged in, navigate to Services
> DNS Resolver. In this section, you will find the settings for Unbound, the default DNS resolver on pfSense. To disable Unbound, uncheck the box labeled Enable at the top of the page. Scroll down and click Save to apply the changes, ensuring that the Unbound service is no longer active.After saving, it is advisable to verify that the Unbound service is stopped. Navigate to Status
> Services, and ensure that the DNS Resolver service is listed as stopped. If it is still running, manually stop the service by clicking the Stop button next to the DNS Resolver entry.Step 3: Configuring DNS Over HTTPS (DoH)
To configure DoH, it is necessary to install a package that supports this protocol. Navigate to System
> Package Manager > Available Packages. Search for a package such as Cloudflared or Stubby, which are popular tools for implementing DoH on pfSense. Click Install next to the chosen package and confirm the installation.Once the installation is complete, configure the package to use a DoH provider. For Cloudflared
, navigate to Services > Cloudflared, and enter the configuration settings to point to a DoH provider like Cloudflare or Google. Typically, this involves specifying the DoH server URL and any authentication keys if required. Save the configuration to ensure that the changes take effect.Step 4: Redirecting DNS Queries to the DoH Service
With the DoH service configured, it is necessary to redirect DNS queries to this service. Navigate to System
> General Setup. In the DNS Server Settings section, remove any existing DNS server entries. Enter the IP address of the local DoH service, typically 127.0.0.1, to ensure that all DNS queries are routed through the DoH service.Ensure that the DNS Server Override
option is unchecked to prevent the system from using ISP-provided DNS servers. Scroll down and click Save to apply these settings. This configuration ensures that pfSense exclusively uses the configured DoH service for DNS resolution.Step 5: Verifying the Configuration
To verify that DNS over HTTPS is functioning correctly, perform a DNS query test. Open a terminal and use a tool like dig
or nslookup to query a domain name. Check the response to ensure that the query is being resolved by the DoH service, which can be confirmed by checking the source IP address in the response.Additionally, review the logs of the DoH service to ensure that DNS queries are being processed correctly. Navigate to Status
> System Logs > System > General, and filter for entries related to the DoH service. Verify that there are no errors and that DNS queries are being logged as expected.Step 6: Securing the Configuration
To secure the DoH configuration, ensure that the pfSense firewall rules allow traffic to the DoH provider. Navigate to Firewall
Regularly update the DoH package and pfSense firmware to protect against vulnerabilities. Check for updates by navigating to System
> Update > System Update, and apply any available updates to maintain security and functionality. By following these steps, pfSense can be configured to use DNS over HTTPS exclusively, enhancing privacy and security for DNS queries on the network.
Integrating Third-Party DoH Services for Enhanced DNS Privacy
To initiate the process of disabling the Unbound DNS resolver on pfSense and transitioning to an exclusive use of encrypted DNS over HTTPS (DoH), it is imperative to first access the pfSense web interface. Navigate to Services
> DNS Resolver and uncheck the Enable checkbox to disable the Unbound DNS service. This step is crucial as it prevents local DNS resolution, ensuring that all DNS queries are routed through the specified DoH service, thereby enhancing privacy and security.Once Unbound is disabled, proceed to configure the system to utilize a third-party DoH provider. Access System
> General Setup and locate the DNS Server Settings section. Here, input the IP addresses of your preferred DoH providers. It is advisable to use well-known public DoH services such as Cloudflare (1.1.1.1), Google (8.8.8.8), or Quad9 (9.9.9.9) for reliable and secure DNS resolution.To ensure that DNS queries are encrypted, pfSense requires the installation of a package capable of handling DoH requests. Navigate to System
> Package Manager > Available Packages and search for a package such as cloudflared or stubby. Select the appropriate package and click Install. This package will facilitate the translation of DNS queries into HTTPS requests, thereby encrypting them.Following the installation, configure the package to start automatically and handle DNS requests. For cloudflared
, edit the configuration file located at/usr/local/etc/cloudflared/config.yml. Input the following configuration:
Example Configuration:
- proxy-dns: true
- proxy-dns-port: 5053
- proxy-dns-upstream:
- - https://1.1.1.1/dns-query
- - https://1.0.0.1/dns-query
Ensure the service is enabled by navigating to Status
> Services and starting the cloudflared service. To enforce DNS over HTTPS, adjust firewall rules to redirect all DNS traffic to the local DoH proxy. Navigate to Firewall > Rules > LAN and create a new rule. Set the Action to Pass, Protocol to TCP/UDP, and Destination Port Range to 53. Under the Redirect Target IP, input 127.0.0.1 and set the Redirect Target Port to 5053.After configuring the firewall rules, test the setup to ensure DNS queries are properly directed through the DoH service. Use diagnostic tools such as nslookup
or dig from a client machine to verify that DNS resolution is functioning as expected. It is critical to confirm that DNS queries are no longer resolved by Unbound or any other local DNS service but are instead routed through the encrypted DoH channel.Finally, continually monitor the performance and security of the DNS setup. Regularly update the DoH package and pfSense firmware to the latest versions to protect against vulnerabilities. By following these comprehensive steps, administrators can effectively disable Unbound DNS resolver on pfSense and leverage third-party DoH services, thereby achieving a higher level of DNS privacy and security.
Recomenda-se também a leitura do guia sobre boas práticas de infraestrutura física e lógica
Testing and Validating DNS Resolution Exclusivity with DoH
To ensure that DNS resolution is exclusively handled by DNS over HTTPS (DoH) on a pfSense system, it is essential to conduct a series of methodical tests and validations. This process involves verifying that the Unbound DNS resolver is completely disabled and that no DNS queries are being processed through traditional unencrypted channels.
Step 1: Verify Unbound DNS Resolver Status
Begin by accessing the pfSense web interface and navigating to Status
> Services. Confirm that the Unbound DNS Resolver service is stopped and not running. If Unbound is active, it must be disabled to prevent any potential conflicts with DoH.Step 2: Check DNS Resolver Configuration
Navigate to Services
> DNS Resolver and ensure that the option Enable Unbound is unchecked. This ensures that Unbound does not automatically start on system boot, maintaining the exclusivity of DoH for DNS queries.Step 3: Configure DNS Over HTTPS (DoH) Client
Set up a DoH client on pfSense, such as cloudflared
or dnscrypt-proxy. This involves installing the client using the package manager and configuring the client to use a DoH server like Cloudflare's or Google's. Ensure that the DoH client is configured to start on boot and is actively running.Step 4: Validate DNS Query Path
Open a terminal on a client machine within the network and use the nslookup
or dig command to perform a DNS query. For example, executedig @127.0.0.1 dominetec.local to check if the query is resolved through the local DoH client. The response should indicate that the DNS query was processed by the DoH client, confirming that no traditional DNS resolver is involved.
Step 5: Monitor Network Traffic
Utilize packet capture tools available in pfSense under Diagnostics
> Packet Capture to monitor DNS traffic. Set the capture interface to the WAN and filter for DNS port 53 traffic. The absence of DNS queries on port 53 signifies that all DNS requests are being securely tunneled over HTTPS, indicating successful DoH exclusivity.Step 6: Analyze DNS Logs
Review the logs generated by the DoH client for any DNS queries processed. This can typically be done by accessing the client’s log files, which are usually located in the /var/log
Step 7: Perform External DNS Leak Test
Visit an online DNS leak test site from a client machine within the network. These sites will perform a series of DNS queries and report the DNS servers that were used. The results should only show the IP address of the DoH server configured in the DoH client, confirming that no external DNS servers are being contacted.
Step 8: Confirm with Firewall Rules
Inspect the firewall rules in pfSense to ensure that any outbound traffic on port 53 is blocked. Navigate to Firewall
> Rules and check the LAN or applicable interface rules. A rule should be present that explicitly denies any traffic destined for port 53, reinforcing the use of DoH exclusively.Step 9: Test with Multiple Devices
Conduct DNS resolution tests from multiple devices within the network to ensure consistent behavior. Each device should show identical results, indicating that the network-wide DNS resolution is exclusively handled by DoH.
Step 10: Document and Review Configuration
Finally, document all configurations and test results to maintain a record of the DNS setup. Regularly review and update the DoH client and pfSense configurations to adapt to any changes in DNS server addresses or security policies, ensuring continued DNS resolution exclusivity with DoH.

Frequently Asked Questions (FAQ)
How can I disable the Unbound DNS Resolver on pfSense?
To disable the Unbound DNS Resolver on pfSense, navigate to Services > DNS Resolver. Uncheck the "Enable" checkbox and click "Save" to apply the changes.
What steps are necessary to configure pfSense to use DoH exclusively?
After disabling Unbound, install a DoH client such as Cloudflared. Configure it by editing the configuration file to specify the DoH server and ensure the service starts automatically on boot.
Why should I consider using DoH over the traditional DNS resolver?
DoH encrypts DNS queries, enhancing privacy and security by preventing eavesdropping and manipulation of DNS data. It is beneficial in protecting user data from potential threats and surveillance.
Are there any potential issues when switching from Unbound to DoH on pfSense?
Switching may introduce latency due to encryption overhead and dependency on external DoH servers. Ensure that the DoH client is properly configured to mitigate potential connectivity issues.



