Open Source

    How to Change DNS on OPNsense

    By [FILL IN], [FILL IN] · Last updated

    OPNsense uses Unbound; configure query forwarding.

    Before you start

    You need a FirewallDNS account (see pricing). Sign in to your dashboard, register your public IP address and copy your DNS server addresses. Replace <FIREWALLDNS-PRIMARY> and <FIREWALLDNS-SECONDARY> below with them.

    Step by step

    1. System > Settings > General: add <FIREWALLDNS-PRIMARY> and <FIREWALLDNS-SECONDARY>. Untick "Allow DNS server list to be overridden by DHCP/PPP on WAN".
    2. Services > Unbound DNS > Query Forwarding: enable "Use System Nameservers" or add the FirewallDNS servers explicitly.
    3. Services > ISC DHCPv4 > LAN: DNS servers empty (use OPNsense) or set FirewallDNS.
    4. Add a NAT port forward redirecting LAN DNS to the firewall.

    Verify it works

    1. Renew DHCP on a client (Windows: ipconfig /renew, macOS: reconnect Wi-Fi).
    2. Run nslookup example.com and check which server answered.
    3. Open the live log in your dashboard. New lookups should appear within seconds.

    Learn more

    Not protected yet?

    FirewallDNS costs $2.90 per device per month.