Post

OPNsense 25.7 DNS Issues: Migrating from Unbound to dnsmasq

Complete guide to resolving DNS resolution failures after upgrading to OPNsense 25.7, including step-by-step migration from Unbound to dnsmasq for improved stability and local hostname resolution in home networks.

OPNsense 25.7 DNS Issues: Migrating from Unbound to dnsmasq

If you’ve recently upgraded to OPNsense 25.7 and are experiencing intermittent DNS resolution failures, you’re not alone. Many users have reported issues where websites become unreachable, then mysteriously work again after cache flushes or reboots. The culprit? Changes in how DNS services interact in the new version.

In this post, I’ll walk you through the issues introduced in OPNsense 25.7 and show you how to migrate from the problematic Unbound setup to a more stable dnsmasq configuration.


🚨 What Changed in OPNsense 25.7?

OPNsense 25.7 introduced several significant changes that have disrupted previously stable DNS configurations:

πŸ”„ Default DHCP Service Switch

The most significant change is that dnsmasq became the default DHCP service instead of ISC DHCP. While this change improves performance and simplifies configuration for most users, it has created compatibility issues with existing Unbound DNS setups.

πŸ› Unbound DNS Resolution Issues

Users are reporting widespread DNS resolution failures with symptoms including:

  • Intermittent β€œserver not found” errors in browsers
  • Lag and timeouts when accessing websites
  • Local hostname resolution failures (devices can’t resolve each other by name)
  • Cache flush temporarily fixes issues but problems return

The issues appear to affect both:

  • Fresh installations of OPNsense 25.7
  • Upgraded systems from previous versions

πŸ” Understanding the Root Cause

The problems stem from several interrelated issues:

  1. DHCP Service Migration: The switch from ISC DHCP to dnsmasq broke existing DNS registration workflows
  2. Unbound Instability: The new version of Unbound has compatibility issues with the changed DHCP environment
  3. Configuration Mismatches: Previous configurations that worked fine now conflict with the new service architecture

πŸ“Š Impact on Local DNS

One of the most frustrating issues is the complete failure of local hostname resolution. In previous versions, devices like laptop.local or server.internal would resolve automatically. After the upgrade, these lookups fail entirely, requiring manual IP address management.


πŸ› οΈ Solution: Migrate to dnsmasq for DNS

The most effective solution is to configure dnsmasq as both the DHCP and DNS service, replacing Unbound entirely. This provides:

  • βœ… Stable DNS resolution without random failures
  • βœ… Automatic local hostname registration for DHCP clients
  • βœ… Simplified configuration with fewer moving parts
  • βœ… Better integration with the new DHCP service

πŸ“‹ Step-by-Step Migration Guide

🎯 Step 1: Disable Unbound DNS

First, we need to disable the problematic Unbound service:

  1. Navigate to Services β†’ Unbound DNS β†’ General
  2. Uncheck β€œEnable” to disable Unbound
  3. Change the Listen Port from 53 to 53053 (we’ll use this later if needed)
  4. Apply the changes

🎯 Step 2: Configure dnsmasq for DNS

Now we’ll set up dnsmasq to handle DNS resolution:

  1. Go to Services β†’ Dnsmasq DNS & DHCP β†’ General
  2. Enable dnsmasq by checking the β€œEnable” box
  3. Set Listen Port to 53 (the standard DNS port)
  4. Configure the following settings:
    • Interface: LAN (and other internal interfaces) - Interfaces to serve DNS requests
    • Do not forward to system DNS: βœ… Checked - Forces manual DNS server configuration
    • DHCP fqdn: βœ… Checked - Enables automatic local domain registration
    • DHCP default domain: internal - Local domain name for your network
    • DHCP register firewall rules: βœ… Checked - Automatically creates firewall rules
  5. Apply the configuration

🎯 Step 3: Configure Upstream DNS Servers

Set up external DNS servers for internet resolution:

  1. Go to Services β†’ Dnsmasq DNS & DHCP β†’ Domains
  2. Add a new domain entry:
FieldValueDescription
Domain*Matches all domains
IP Address1.1.1.1Cloudflare DNS (or your preferred DNS)
Port53Standard DNS port
  1. Add additional upstream servers for redundancy:
    • 8.8.8.8 (Google DNS)
    • 9.9.9.9 (Quad9 DNS)

🎯 Step 4: Configure DHCP Ranges

Set up DHCP ranges with automatic DNS registration:

  1. Go to Services β†’ Dnsmasq DNS & DHCP β†’ DHCP ranges
  2. Add a range for your LAN:
FieldValueExample
InterfaceLANYour main network interface
Start address192.168.1.100First IP in DHCP range
End address192.168.1.199Last IP in DHCP range
Domainlan.internalLocal domain for this range
Lease time8640024 hours (in seconds)
  1. Apply the configuration

🎯 Step 5: Update System DNS Settings

Configure OPNsense to use the new DNS setup:

  1. Go to System β†’ Settings β†’ General
  2. Remove any existing DNS servers
  3. Add your dnsmasq instance: 127.0.0.1
  4. Uncheck β€œAllow DNS server list to be overridden by DHCP/PPP on WAN”
  5. Apply changes

πŸ§ͺ Testing the New Configuration

βœ… Test Internet Resolution

From a client device, test external DNS resolution:

1
2
nslookup google.com
ping cloudflare.com

βœ… Test Local Hostname Resolution

Test automatic hostname registration:

1
2
3
# From one device, try to reach another by hostname
ping laptop.lan.internal
nslookup server.lan.internal

βœ… Verify DHCP Registration

  1. Check Services β†’ Dnsmasq DNS & DHCP β†’ Log
  2. Look for DHCP lease entries showing hostname registration
  3. Verify clients receive correct DNS server (should be your OPNsense LAN IP)

πŸ”§ Advanced Configuration Options

🎯 Configure Local Host Overrides

For devices that need static DNS entries:

  1. Go to Services β†’ Dnsmasq DNS & DHCP β†’ Hosts
  2. Add static entries:
FieldValueExample
HostnasHostname
Domainlan.internalLocal domain
IP addresses192.168.1.50Static IP

🎯 Set Up Custom DNS Blocking

For ad-blocking or content filtering:

  1. Go to Services β†’ Dnsmasq DNS & DHCP β†’ Domains
  2. Add blocking entries:
FieldValueDescription
Domainads.example.comDomain to block
IP Address127.0.0.1Redirect to localhost

🚨 Troubleshooting Common Issues

πŸ” DNS Resolution Still Failing

If you’re still experiencing issues:

  1. Check firewall logs for blocked DNS traffic
  2. Verify DHCP clients are getting correct DNS server
  3. Flush DNS cache on client devices
  4. Restart dnsmasq service from Services menu

πŸ” Local Hostnames Not Resolving

For local name resolution problems:

  1. Verify DHCP fqdn is enabled
  2. Check that clients are sending hostnames in DHCP requests
  3. Ensure domain is configured in DHCP ranges
  4. Review dnsmasq logs for registration messages

πŸ” AdGuard Home Integration Issues

If you’re using AdGuard Home:

  1. Configure AdGuard to use upstream DNS servers instead of OPNsense
  2. Point DHCP clients directly to AdGuard instead of dnsmasq
  3. Use separate ports to avoid conflicts

πŸ“Š Performance Comparison

MetricUnbound (25.7)dnsmasq
Stability❌ Frequent failuresβœ… Reliable
Local DNS❌ Brokenβœ… Automatic
Configuration🟑 Complexβœ… Simple
Memory Usage🟑 Higherβœ… Lower
Startup Time🟑 Slowerβœ… Faster

πŸ”„ Reverting if Needed

If you need to revert to Unbound:

  1. Disable dnsmasq DNS (set Listen Port to 0)
  2. Re-enable Unbound (Services β†’ Unbound DNS β†’ General)
  3. Restore Unbound to port 53
  4. Reconfigure upstream DNS servers in Unbound settings

🧠 Final Thoughts

The DNS issues in OPNsense 25.7 are frustrating, but the migration to dnsmasq provides a more stable and feature-rich solution. The automatic hostname registration and simplified configuration make network management much easier.

Key benefits of the migration:

  • 🎯 Eliminates random DNS failures
  • 🏠 Restores local hostname resolution
  • ⚑ Improves overall network performance
  • πŸ”§ Simplifies ongoing maintenance

While the upgrade disruption is inconvenient, the end result is a more robust DNS infrastructure that’s better suited for home and small business networks.

The community feedback suggests that this configuration is not only more stable but also aligns better with OPNsense’s direction for future releases. Many users report that after making this switch, their networks are more reliable than they were even before the 25.7 upgrade.

This post is licensed under CC BY 4.0 by the author.