Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Different DNS server for each VLAN

    Scheduled Pinned Locked Moved DHCP and DNS
    3 Posts 2 Posters 1.2k Views 1 Watching
    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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
          Privacy Policy · Cookie Policy