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

    force local hostname resolution behind internet box

    Scheduled Pinned Locked Moved DHCP and DNS
    16 Posts 3 Posters 604 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.
    • V
      viragomann @johnpoz
      last edited by

      @johnpoz said in force local hostname resolution behind internet box:

      You don't put a gateway on your "lan" this turns it into a wan interface..

      Obviously he use pfSense only for DHCP and DNS without a WAN interface. And the stated gateway on the LAN is the internet router.
      So I think, it should work with the LAN gateway.

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

        @viragomann not really how you would do it.. When pfsense only has 1 interface, this would be wan... And you could use it for what you want to use it for in that configuration.

        So actual details of what the user is wanting to do, and how was it setup before? They mention.. "I temporarily made some chance on my design"

        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

        R 1 Reply Last reply Reply Quote 0
        • R
          rjcab @johnpoz
          last edited by

          Thanks both of you.

          Yes :

          Obviously he use pfSense only for DHCP and DNS without a WAN interface. And the stated gateway on the LAN is the internet router.
          So I think, it should work with the LAN 
          
          

          And the box has LAN in 192.168.1.0/24 and the WAN interface of the box is in 178.xxx.xxx.xxx

          Am running out of battery, after charging I will make the test on the laptop

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

            @rjcab when you setup pfsense for such a purpose, and this would be pfsense wan, even if on your "lan"..

            There are much easier ways to run dhcp/dns services then firing up pfsense for such mundane services.. pihole can do this for example..

            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

            R 1 Reply Last reply Reply Quote 0
            • R
              rjcab @johnpoz
              last edited by

              @johnpoz you are right but this is juste for couple of weeks

              johnpozJ R 2 Replies Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator @rjcab
                last edited by

                @rjcab and a pihole would take all of like 2 minutes to setup, and specifically designed for exactly this - provide dns and also can do dhcp.. Vs software that is meant to be your router/firewall and has very advanced functions and a more complicated setup to be used for such a purpose. And meant to run clean on the box/vm as the only OS... While pihole can just run as some software on any linux distro or as just a docker on any os, etc..

                But hey you do you.. But I would expect issues if your trying to tell pfsense hey this is your lan, but hey use it as your wan, etc..

                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

                R 1 Reply Last reply Reply Quote 0
                • R
                  rjcab @rjcab
                  last edited by

                  
                  ➜  ~ dig
                  
                  ; <<>> DiG 9.10.6 <<>>
                  ;; global options: +cmd
                  ;; Got answer:
                  ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 1036
                  ;; flags: qr rd ad; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
                  ;; WARNING: recursion requested but not available
                  
                  ;; Query time: 52 msec
                  ;; SERVER: 192.168.1.1#53(192.168.1.1)
                  ;; WHEN: Sat Feb 24 23:18:51 CET 2024
                  ;; MSG SIZE  rcvd: 12
                  
                  ➜  ~ ping jc.local.lan
                  ping: cannot resolve jc.local.lan: Unknown host
                  ➜  ~ 
                  

                  in the static dhcp config:
                  staic.jpg

                  I this config, no internet access, I need I think to specify somewhere in Pfsense the path or DNS to go outside the LAN.
                  For the hostname resolution I don't know as the IP address for DNS 1.1 is the right one

                  1 Reply Last reply Reply Quote 0
                  • R
                    rjcab @johnpoz
                    last edited by

                    @johnpoz Sure, But in this way I learn a lot about pfsense :-)

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

                      @rjcab I am not sure using something in a way its not actually meant to be used is learning about it ;) But hey have fun..

                      Btw if your using kea, static reservations will not show up for dns.. And if using isc, you have to tell unbound to register static dhcp reservations..

                      And your query was refused, so wouldn't matter even if pfsense had a record it could answer with... So you have your ACLs not correct in unbound.

                      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

                      R 1 Reply Last reply Reply Quote 0
                      • R
                        rjcab @johnpoz
                        last edited by

                        @johnpoz
                        dsc.jpg

                        but i didnot understand the unbound stuff, I will look at

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

                          @rjcab out of the box pfsense creates automatic ACL (access control lists) to allow say your lan to query it.. But how you have it setup I don't know what the ACLs would be set to, if pfsense thinks lan is a wan, it might not allow queries because well normally you wouldn't want to provide dns to say the internet ;)

                          That refused there is saying unbound refused to serve you what you asked for.. You may need to manually adjust unbounds ACLs.

                          I do not believe register static is enabled by default, but your going to want that set as well

                          unbound.jpg

                          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

                          1 Reply Last reply Reply Quote 0
                          • R
                            rjcab
                            last edited by

                            already enabled:

                            dd.jpg

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

                              @rjcab well that refused when you did a dig screams acls.. Manually set it to allow your network to query..

                              I am not 100% sure if just creating one overrides auto, etc.. So you might want to disable the auto, and just create your own

                              acl.jpg

                              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

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