Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Different DNS server for each VLAN

    Scheduled Pinned Locked Moved DHCP and DNS
    3 Posts 2 Posters 754 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      endpoint-credible
      last edited by endpoint-credible

      Hello,

      I have the following configuration of a pfSense box:
      VLAN1
      Gateway: VPN (OpenVPN)

      VLAN2
      Gateway: WAN

      I would need to achieve the following outcome:

      • all DNS queries comming through VLAN1 to use DNS server 1 (VPN server)
      • all DNS queries comming through VLAN2 to use DNS server 2 (Cloudflare server).

      Any ideas on how this can be achieved?


      >> Some other settings on this pfSense box:

      DNS Forwarder: not enabled

      System > General Setup
      DNS Servers: Cloudflare, with WAN Gateway
      DNS Server Override: OFF
      DNS Resolution Behavior: Use local DNS, ignore remote DNS servers

      DNS Resolver: enabled
      Network interfaces: All
      Outgoing Network Interfaces:

      Custom options:

      server:
      forward-zone:
      name: "."
      
      # Cloudflare
      forward-ssl-upstream: yes
      forward-addr: 1.1.1.1@853
      forward-addr: 1.0.0.1@853
      
      server:include: /var/unbound/pfb_dnsbl.*conf
      

      Services > DHCP Server
      Any DNS entries made here (for VLANs) seem to be ignored, even if the VLANs are not selected in the DNS Resolver under Network interfaces.

      VPN > OpenVPN > Clients > Edit
      Tunnel Settings

      Pull DNS: Not ticked

      pfBlockerNG active

      Thanks for reading this.

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @endpoint-credible
        last edited by

        @endpoint-credible
        Simply forward DNS request with a NAT port forwarding rule on the respective interfaces.

        1 Reply Last reply Reply Quote 1
        • E
          endpoint-credible
          last edited by

          @viragomann
          What a straight-forward solution! Thanks!
          It works as expected now.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.