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

    DNS Resolver Host Override not working

    DHCP and DNS
    5
    25
    7.4k
    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.
    • L
      l0rdraiden
      last edited by l0rdraiden

      I have configured host overridde, the thing is if I start the computer it doesnt work but If I go to pfsense and edit the host override without doing any change and click on save and apply, suddently it works. Then for now reason It stops working.

      0_1548590328285_1bdf9ab9-d8a6-42db-81fc-b9417246a1dd-imagen.png

      Apparently while it doesnt work I get a DNS rebinding error, and it looks like is trying to use pfsense cert to access to this website, and a nslookop resolvers the pfsense IP.

      When It works I get this
      0_1548590193988_627d3113-f537-4a15-8af7-780a52555ba5-imagen.png

      I'm trying to access to an nginx webserver

      I'm using pfblockerng in case it means something, I think it restarts the DNS service everytime it updates

      1 Reply Last reply Reply Quote 0
      • L
        l0rdraiden
        last edited by l0rdraiden

        0_1548604431378_3f4a6964-f4a7-4149-b095-b370061a9d98-imagen.png

        When it doesn't work it resolves the public IP despite it is configure to resolve a local IP.

        This is the config

        0_1548604641194_dd70b741-f168-40f8-8210-02c5b77081fa-imagen.png

        1 Reply Last reply Reply Quote 0
        • GertjanG
          Gertjan
          last edited by Gertjan

          Some words have already been posted about xxxx.duckdns.org (or any DDNS for that matter).

          I wouldn't make a host over ride like this :

          0_1548610368041_f92c0c01-e118-45d9-90a6-14caaa524946-image.png

          => No host ???????

          Your Resolver has become a 'no-brain' forwader (thenn why not using the dnsmasq forwarder ?):

          0_1548610339060_5b81cb65-2669-47f4-9ad8-b06ccea91692-image.png

          What happens is :
          Your xxx.duckdns.org resolver requests are forwarded ... (send away, upstream)
          The upstream request "wins" and your answer will be wrong.

          The answer will be cached - and your local host override, coming in later in the list will always "loose".

          Start by using the resolver as a resolver and you'll be ok.
          Repair also your host override - it really looks strange to me.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          L 1 Reply Last reply Reply Quote 0
          • nodauN
            nodau
            last edited by

            also, use localhost or all interfaces for outgoing traffic.

            Norman

            virtualized pfSense 2.7.2 HA-Cluster on vsphere 8

            1 Reply Last reply Reply Quote 0
            • L
              l0rdraiden @Gertjan
              last edited by

              @gertjan
              now it's like this
              0_1548615204431_13ed705a-a0da-4088-8d0b-dee6b6d87c31-imagen.png

              I use resolver because I can configure DNSSEC

              @bahsig what do you mean exactly?

              johnpozJ 1 Reply Last reply Reply Quote 0
              • nodauN
                nodau
                last edited by nodau

                your outgoing network interface in dns resolver shows wan only. change this to “all“ or “localhost“. and disable forwarding mode.

                Norman

                virtualized pfSense 2.7.2 HA-Cluster on vsphere 8

                L 1 Reply Last reply Reply Quote 0
                • L
                  l0rdraiden @nodau
                  last edited by

                  @bahsig said in DNS Resolver Host Override not working:

                  an only. change this to “all“ or “localhost“. and

                  Now outgoing network interfaces is set in ALL but still doesnt work.
                  My question is, can this work without disabling the fordwarding mode? This configuration worked for me in the past but I don't know why now is failing
                  I guess that my DNS request will be faster in forwarding mode using 1.1.1.1 than in resolver.

                  GertjanG 1 Reply Last reply Reply Quote 0
                  • GertjanG
                    Gertjan @l0rdraiden
                    last edited by

                    @l0rdraiden said in DNS Resolver Host Override not working:

                    I guess that my DNS request will be faster in forwarding mode using 1.1.1.1 than in resolver.

                    Impossible.
                    Check the file /etc/hosts
                    There is your host override - so it's already in the resolver cache.

                    And if you try to resolve nxxxx.duckdns.org upstream you wind up having the wrong IP - of course.

                    Btw : Forwarding ok, but forget about DNSSEC then, as discussed many times already.

                    No "help me" PM's please. Use the forum, the community will thank you.
                    Edit : and where are the logs ??

                    L 1 Reply Last reply Reply Quote 0
                    • L
                      l0rdraiden @Gertjan
                      last edited by l0rdraiden

                      @gertjan

                      Now I am using DNS resolver as you said with forwarding disable, still the host override works for a while and then it starts to resolve the public IP instead the local IP. What is causing this?

                      The thing is if I change any settings in the DNS resolver and then I apply changes the host override works, and then it stops working. So I think something else is causing this.

                      When I try to resolve the domain in a browser in pfsense logs appears this (i have added the ***)

                      Jan 29 08:18:32 pfsense.homelocal nginx: 2019/01/29 08:18:32 [error] 83403#100162: 262 open() "/usr/local/www/index.php/204" failed (20: Not a directory), client: 192.168.1.30, server: , request: "GET /index.php/204 HTTP/1.1", host: "ne*********.duckdns.org"

                      Jan 29 08:03:07 pfsense.homelocal nginx: 2019/01/29 08:03:07 [error] 83100#100167: 260 open() "/usr/local/www/ocs/v1.php/cloud/user" failed (2: No such file or directory), client: 192.168.1.30, server: , request: "GET /ocs/v1.php/cloud/user?format=json HTTP/1.1", host: "tc***s.duckdns.org"

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

                        @l0rdraiden said in DNS Resolver Host Override not working:

                        I use resolver because I can configure DNSSEC

                        But if your forwarding you throw that out anyway... The resolver is where dnssec happens, if your forwarding its pointless to ask for dnssec info, etc. Your adding extra traffic for no reason.

                        Are you using proxy? Or HA proxy?
                        What do you have pfsense pointing to for dns? It should only post to loopback if you want it to use your overrides.

                        @bahsig said in DNS Resolver Host Override not working:

                        your outgoing network interface in dns resolver shows wan only. change this to “all“ or “localhost“. and disable forwarding mode.

                        There is no reason to change his outgoing to ALL.. And unless he is using multiple wan, he could for sure just use wan and not have to have localhost selected for outgoing. What is your reasoning behind having to have localhost selected for the outgoing interface?

                        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.7.2, 24.11

                        L 1 Reply Last reply Reply Quote 0
                        • L
                          l0rdraiden @johnpoz
                          last edited by

                          @johnpoz said in DNS Resolver Host Override not working:

                          @l0rdraiden said in DNS Resolver Host Override not working:

                          I use resolver because I can configure DNSSEC

                          But if your forwarding you throw that out anyway... The resolver is where dnssec happens, if your forwarding its pointless to ask for dnssec info, etc. Your adding extra traffic for no reason.

                          Are you using proxy? Or HA proxy?

                          What do you have pfsense pointing to for dns? It should only post to loopback if you want it to use your overrides.

                          But when I use forwarding to a server like 1.1.1.1 DNSSEC works.

                          I'm using nginx with letsencrypt, right now the DNS is working as a resolver and the host override is pointing to the nginx server.
                          I am using suricata and pfblockerng in case this matters.

                          The funny thing is that If I edit the host override or a setting in the DNS resolver it works for a while, it resolves 192.168.1.220 and then after 15-20 mins or so it resolves again the public IP.

                          This was working well in the past but I can't remember what I have changed in order to break it, I will try to disable pfblockerng to see if it changes the behavior.

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

                            @l0rdraiden said in DNS Resolver Host Override not working:

                            But when I use forwarding to a server like 1.1.1.1 DNSSEC works.

                            If where you forward to does dnssec - then yeah you get dnssec, you don't have to have it checked.. The resolver is what does dnssec.. You asking for it or not asking for it has nothing to do with it the resolver does it or not.

                            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.7.2, 24.11

                            L 1 Reply Last reply Reply Quote 0
                            • L
                              l0rdraiden @johnpoz
                              last edited by

                              @johnpoz

                              But do you know why the host override works for a while and then stops working?

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

                                Not off the top... Trying to figure out what that error is you posted. That is pfsense trying to get something with nginx?

                                Do you have pfsense pointing to anything other than localhost for dns?

                                In your system widget what does it show for dns?

                                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.7.2, 24.11

                                L GertjanG 2 Replies Last reply Reply Quote 0
                                • L
                                  l0rdraiden @johnpoz
                                  last edited by

                                  @johnpoz

                                  1. Yes but I don't know what is trying to get
                                  2. No, DNS general settings is empty and the DNS in the clients is the pfsense IP
                                  3. enable up and running.

                                  BTW I have disable pfblockerng and now it works fine... so I guess is some kind of incompatibility. I will try to report it to see if I get the dev to read this thread.

                                  1 Reply Last reply Reply Quote 0
                                  • GertjanG
                                    Gertjan @johnpoz
                                    last edited by

                                    @johnpoz said in DNS Resolver Host Override not working:

                                    That is pfsense trying to get something with nginx?

                                    Yeah, what is this :

                                    @l0rdraiden said in DNS Resolver Host Override not working:

                                    ...... open() "/usr/local/www/index.php/204" failed (20: Not a directory), client: 192.168.1.30, server: , request: "GET /index.php/204 HTTP/1.1", host: "ne*********.duckdns.org"
                                    .... open() "/usr/local/www/ocs/v1.php/cloud/user" failed (2: No such file or directory), client: 192.168.1.30, server: , request: "GET /ocs/v1.php/cloud/user?format=json HTTP/1.1", host: "tc***s.duckdns.org"

                                    /index.php/204 => this doesn't exists on pfSense (the web server / files ).
                                    //ocs/v1.php/cloud/user => same thing.

                                    Just the browser who 'thinks' it's connected to some site, but redirected to the pfSense webroot, and obtaining a "non - not here".

                                    No "help me" PM's please. Use the forum, the community will thank you.
                                    Edit : and where are the logs ??

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

                                      @Gertjan you think that is something to do with his host override trying to ask pfsense for something... I can not really tell what that error is without more context.

                                      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.7.2, 24.11

                                      RonpfSR 1 Reply Last reply Reply Quote 0
                                      • GertjanG
                                        Gertjan
                                        last edited by

                                        Realy, .... dono.

                                        I guess @l0rdraiden want to reach a local server (coming from local), the server he exposes on the Internet using a duckdns.org DDNS domain name.
                                        Local host overrides always worked for me, using the default Resolver.

                                        No "help me" PM's please. Use the forum, the community will thank you.
                                        Edit : and where are the logs ??

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

                                          yup zero issue with them.. But I don't see how an error on pfsense for nginx has anything to do with 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.7.2, 24.11

                                          1 Reply Last reply Reply Quote 0
                                          • GertjanG
                                            Gertjan
                                            last edited by

                                            IMHO, the errors are cached URL's in a browser, that thinks it's connected to a webserer (dsame URL) but it is connected to the GUI (or portal web server).
                                            It's hitting the server (nginx) with the stored URL's and nginx is complaining about it.
                                            I see this all the time on my own web servers : the most strange page requests are popping up - and errored out by the web server.

                                            No "help me" PM's please. Use the forum, the community will thank you.
                                            Edit : and where are the logs ??

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