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

    DNS for mulitple VLANS

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 3 Posters 463 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.
    • T
      tompark
      last edited by stephenw10

      Hi All,
      I have a question im struggling to find the answer too. So im hoping someone here can help.

      I have 2 subnets where all traffic is blocked between them.

      I the have a server that exists on both with the name nas.example.com with IP 192.168.1.50 amd 192.168.11.50.

      When a machine on the 192.168.1.x subnet queries for nas.example.com, i only want pfsense to return the IP for the same subnet.

      I have seen this is possible the the DNS Forwarder function, but is the same possible for the DNS Resolver?
      Any help or pointers would be appreciated.
      Regards,

      S johnpozJ 2 Replies Last reply Reply Quote 0
      • S
        SteveITS Galactic Empire @tompark
        last edited by

        @tompark unbound has a “view” feature but I don’t know any details offhand so it’s not much of a pointer but might help.

        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
        Upvote 👍 helpful posts!

        1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @tompark
          last edited by johnpoz

          @tompark yeah as @SteveITS mentions you can setup a views to do this.. I have gone over it a few times in multiple posts.. Let me see if I can find one of my old posts.

          edit: here is post from back in 2017 ;)

          https://forum.netgate.com/post/684870

          I know I have done since then with more details... Hold on

          edit2: here is a whole thread trying to help the guy setup a simple view - but never actually got exactly what he was wanting to do or to what.. But there are multiple posts in there by me showing how to setup a view.

          https://forum.netgate.com/post/1145332

          You could prob do it with rpz as well vs a view.. I have to step away for a bit, later tonight I might right up both ways to do it.

          You want unbound to return the IP of the nas that is in the same network as the client that is doing the query right..

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          T 1 Reply Last reply Reply Quote 2
          • T
            tompark @johnpoz
            last edited by

            @johnpoz - thank you for the links! Yes I want to return the IP for NAS that is in the same Subnet (not any other subnet).

            A sample guide on something like this might be good for others. I'll have a read of the two threads tomorrow or maybe Monday and see what I come up with.

            johnpozJ 1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @tompark
              last edited by johnpoz

              @tompark so here this is really simple.. So my nas has entry in unbound for 192.168.9.10.. So currently if anything queries nas.home.arpa it gets back 192.168.9.10

              I created a view and access list that says hey anything from 192.168.3.0/24 that queries you, use this entry for nas.home.arpa that has IP of 192.168.3.42

              view.jpg

              So if any of my other networks query for nas.home.arpa they get back the normal 192.168.9.10, if anything from 192.168.3.0 queries they will get 192.168.3.42 as you see above that last query is from a pi I have on the 192.168.3 network.

              Now here is a query from my device I have on the 192.168.2.0/24 network

              ucquery.jpg

              If I get myself motivated can show you how to do with a rpz..

              I had to call out specific IPs on my pfsense when I did the digs, because most of all of my devices point to my pihole, which is on the 192.168.3 network... So currently none of those devices can actually resolve my nas - hehe ;) Time to comment the view out..

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              T 1 Reply Last reply Reply Quote 3
              • T
                tompark @johnpoz
                last edited by

                @johnpoz

                Thank you for the information, unfortunately the screen shots don't load :(.

                I have been reading the unbound docs to learn more about views. Is it possible to get unbound to forward a zone for a particular view to a different DNS server?

                For one of the VLAN's if possible I would like to forward the DNS queries to a Windows DC (I know this is not best practice). Sites on the DC are configured, however is there any changes to unbound I would need to make to ensure the DC returned the right address.

                As for the settings for the views do these get added directly to the configuration files or too the "custom options" box in DNS Resolver.

                Apologies it has taken a while for me to respond a few other things took over meaning I needed to leave this alone for a bit.

                Regards,

                johnpozJ 1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator @tompark
                  last edited by

                  @tompark they did way back almost 3 weeks ago when I posted them.. Seems the latest update to the forum software had some gremlins at work..

                  Forwarding to some other NS can be problematic - I haven't paid attention to see if the latest version of unbound maintains different caches for different views like bind does.

                  Here is where you can have a problem.. User A queries something, and its cached.. Now user B does a query from different IP that view should return something different than what user A got, but since it is in the common cache user B gets what was cached vs what the view should of returned.

                  The views get added to the custom option box..

                  The thread I posted to has really all the details you would need for creating a view.

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    tompark @johnpoz
                    last edited by

                    @johnpoz, hum thats what i thought. I will follow the othere thread and see where I end up.

                    I appreciate all the guidance and adviae that you have proevided. I jave a good base to start from now.

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