Use different DNS providers for both DNS forwarder and DNS Resolver



  • Both DNS forwarder and DNS resolver are setup on my pfSense box.
    I would like one of the two services to use OpenDNS (with their dns filter) and the other one use CloudFlare DNS.

    DNS forwarder uses the DNS settings in System -> General.
    DNS Resolver will use them as well if I set it to forward mode.

    Is there a way I can set DNS forwarder to use OpenDNS and DNS Resolver to CloudFlare DNS?



  • I can't imagine why you would need to do this in the first place.  What's your use case?



  • Not every network is the same.  ;)

    I have a few VLAN's which need to go over OpenDNS (with dns filtering on), the "kids" VLAN.
    Also I have an "admin" VLAN which needs dns filtering off, so I can't use OpenDNS there.



  • I would just modify the DHCP server on the kids VLAN to serve them the OpenDNS servers.



  • But that would not allow me to use host overrides…
    Not an option for me.


  • Rebel Alliance Global Moderator

    To be honest I would just use bind for such complex setup.  While unbound did add views a few versions back.  I do not believe you can add different forwarder options, etc.  So vs running both dnsmasq and unbound.

    Why not just run bind?  Which in that you can create specific views so that IP X or network Y get forwarded to A, while others get forwarded to B, etc.



  • I solved this by running both DNS Forwarder and DNS Resolver.
    DNS resolver on a different port (1053) and setup a port forward.
    DNS forwarder set to forward to OpenDNS and DNS resolver setup with custom options:

    
    server:
    forward-zone:
    name: "."
    forward-ssl-upstream: yes
    forward-addr: 1.1.1.1@853
    forward-addr: 1.0.0.1@853
    
    

    Is does work without TLS/SSL as well:

    
    server:
    forward-zone:
    name: "."
    forward-addr: 1.1.1.1@53
    forward-addr: 1.0.0.1@53
    
    


  • But that would not allow me to use host overrides…
    Not an option for me.

    You didn't mention anything about that requirement.  Glad to see you got something figured out and working.