OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: orange-phone on October 31, 2018, 09:32:40 pm

Title: OPNsense DNS Redirect Help
Post by: orange-phone on October 31, 2018, 09:32:40 pm
I wanted to create a local caching DNS server that would redirect DNS queries by crafting my own DNS answer with the IP to neutralize malware instead of the real IP provided by the real DNS server.
*see illustration attached

I have OPNsense running on a VM with 3 NICs; internet, client and management. These are running on my local machine as a simulation of client access to internet. There is no external internet connection.
             WAN (em1)                                         OPT1 (em2)
                 Internet    ---->    OPNsense   ---->    Client Network
LAN (em0): Used for management (
I configured OPNsense as a Transparent Bridge Connection (OPT2).

I was looking into using Dnsmasq DNS (forwarder) to accomplish this, however have not been successful so far. Here is the current set up I have:
I have assigned as my DNS server under System>Settings>General>DNS servers. I’ve created a file in /etc/extra that stores the domains that I would like blocked as well as the IP that I want to redirect to (eg. www.test.ca) . I’ve added this file under the Advanced option under Services>Dnsmasq DNS>Settings.

When I do a DNS lookup through the OPNsense GUI I get the correct response. However, when I do nslookup www.test.ca from my client network I do not get the response that I`m looking for (

How do I get OPNsense to respond to my client network with the IP

Any help would be appreciated!