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

    Import host override list into forwarder

    Scheduled Pinned Locked Moved DHCP and DNS
    39 Posts 3 Posters 13.7k 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.
    • D
      doktornotor Banned
      last edited by

      You'd better wait till it's officially released if unable to find the snapshots.

      1 Reply Last reply Reply Quote 0
      • M
        markn62
        last edited by

        I'll certainly wait for the official release but waiting for a solution to this is not in my DNA.  If I can't find the solution here I google til I find it.  Looks by my last post it was just about an hour.

        I may have found the proper syntax for the dns forwarder advanced box.  Should be; address=/host.domain/x.x.x.x per http://thomasloughlin.com/pfsense-dnsmasq-advanced-setup/

        The forwarder accepts the syntax. I'll see if unbound picks it up after a cron reboot.

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

          Why would unbound pick up stuff you put in the forwarder section??  They are 2 different systems..

          Notice how stuff you put in resolver overrides is not listed in the forwarder gui..

          What are you using the forwarder or the resolver??  Are you trying to use both at the same time?  They can not run on the same port or IP..

          What I can tell you for fact, is stuff you put in the host over rides is for sure placed into the /etc/hosts file - see attached.

          What are you not understanding about the info given.. I have shown you how to import stuff be it the forwarder or the resolver.. What can I do to make it clearer for you - do you need more pictures?

          "What is the easiest place to modify the host overrides where unbound will use them?"

          As already stated you can paste them in the advanced box in the resolver section per my examples above, or you can put those entries in a .conf file in the folder where unbound picks up .conf files if you don't want to paste them into the advanced box.

          If you want to use the resolver, then point to a file per my example and use the correct format IP name in your file.

          hostfile.png_thumb
          hostfile.png

          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
          • M
            markn62
            last edited by

            John,
            Are you serious?  What are you calling a resolver override?  Perhaps we have a terminology misunderstanding.  In the ver 2.1.5 GUI there is only forwarder host overrides, forwarder advanced, and unbound dsn advanced settings - custom options.

            Dok says only use the GUI and you say otherwise yet you don't challenge Dok's suggestion.  And I'm finding your info repeatedly flawed.  Firstly the /etc/hosts file only has two entries, 127.x and my lan ip.  It is not picking up anything from the forwarder overrides or advanced.  Secondly, your suggestion to use addn-hosts=/etc/extra in the forwarder advanced produces an error at the top of this GUI page so referencing a custom hosts file is not do-able even though you insist it does.  It's not a file name or content issue, its a syntax issue.

            So yes, I have tried all your suggestions with failure.  I get it and don't need pictures.  Anyone who has used PfSense for any time knows the unbound package uses the forwarder host overrides. You only need to cat /usr/pbi/unbound-amd64/etc/unbound/unbound.conf to understand this. And the forwarder doesn't have to be enabled for this to happen.  Certainly I'm not using the forwarder and unbound together.  Again if you've used PfSense for any time you would know enabling the forwarder will stop the unbound service so it's not possible to run concurrently, so why ask if I am?

            I did determine after this AM's cron reboot that the forwarder advanced entry of "address=/host.domain/x.x.x.x doesn't get picked up by unbound even though the forwarder doesn't choke on it.  So still looking for a practical solution to entering a couple hundred private host overrides so nTopNG can DNS resolve the private IP's.  So far only the forwarder override entries and the DHCP static leases are making it into the unbound.conf file.

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              @markn62:

              Anyone who has used PfSense for any time knows the unbound package uses the forwarder host overrides.

              Not any more on 2.2 since it is not a package in the first place there. Stop sticking the overrides to obsolete places that were not intended for this anyway. If you want overrides for unbound, then kindly use the already suggested proper method above, or simply install 2.2 and use the GUI.

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

                ^ exactly.. What version are you on?  Are you still using 2.1.5?  With unbound package?  2.2 integrated unbound as the resolver.

                Do you want me to remote in and set it up for you?  I can not help you if your trying to use unbound as a package and leverage the forwarder overrides, or how that used the forwarder stuff?  I never used the package other than some quick look at it.  But if your on 2.2 the info I have given is valid and tested on my own system and works as I have described.

                If your using the unbound package, you should be able to put the entries as I have shown in a .conf file in the directory where unbound loads its .conf and have it load in whatever hosts you need.

                I can always fire up my 2.1.5 vm and install the package and validate that.

                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
                • D
                  doktornotor Banned
                  last edited by

                  The advanced config works the same with the 2.1.x package, except that you need trailing ; on each advanced config line, IIRC.

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

                    Yup and its in a different tab under the package gui page unbound advanced dns settings at the bottom there is custom box

                    So I just validated this works, you don't need server: in the package.  Not sure the package loads .conf files like the 2.2 integration does.

                    This is off 2.1.5 i386 vm.. Turned off forwarder, enabled unbound package.

                    unboundpackage.png
                    unboundpackage.png_thumb

                    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
                    • M
                      markn62
                      last edited by

                      Ahhh, so while I've been testing DNS Forwarder advanced entries you all have been talking Unbound Dns Advanced Settings.  And to not add a ; after address=/host.domain/x.x.x.x but after each line using syntax like so:

                      local-data: "click01.aditic.net A 10.10.10.1";
                      local-data: "click02.aditic.net A 10.10.10.2";

                      No wonder that above gave an error in the DNS Forwarder.  I've already been using this area with entries:
                      forward-zone:;name: ".";
                      forward-addr: 8.8.8.8;
                      forward-addr: 8.8.4.4;
                      forward-addr: 4.2.2.1;

                      And yes I'm still running version 2.1.5.  If I knew 2.2 was stable, and how to upgrade to it differently than using the firmware update GUI page, I might be inclined too.  Not sure why I'm getting dogged for not using a beta version.  This is a production box I can't just fiddle with anytime I wish.

                      Thanks for clarifying this.  Figured we had to be miscommunicating cause no suggestions seemed to work. I'll try Unbound Dns Advanced Settings - Custom Options entries later today, out of time this AM.

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

                        Here is the thing in your first post you stated forwarder, but then said there were unbound errors.  I asked for clarification right off the bat were you using the "forwarder" or unbound - with you saying unbound I also maybe in error assumed you were on 2.2.  Which is when unbound was integrated since you made no mention of using the "package"

                        IMHO 2.2 is stable - there are 0 bugs left that I am aware of, and been RC for quite some time.  It could drop final any day I would think.  To upgrade too it all you have to do is grab snap.  http://snapshots.pfsense.org/  There has not been a update since the 16, which also points to final being any day now ;)  Normally snaps are produced like twice a day.

                        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
                        • M
                          markn62
                          last edited by

                          Well I had a response but got snagged by the login timeout and forgot to copy/paste my post before submitting.  So I'll just apologize for assumptions made and the long thread.

                          1 Reply Last reply Reply Quote 0
                          • M
                            markn62
                            last edited by

                            Entered

                            server:
                            local-data: "click01.aditic.net A 10.10.10.1"

                            into Unbound Dns Advanced Settings and works like a champ.  Helps when put in the proper GUI location.  ;)

                            Thanks again guys for your help and patience.

                            1 Reply Last reply Reply Quote 0
                            • M
                              markn62
                              last edited by

                              Well that's a peach.  After all this effort to get a local ip / hostname relationship established in Unbound it appears neither nTopNG or Bandwidthd use Unbound to resolve the locals, both still show IP's.  I have nTopNG set to "Decode DNS responses and resolve all numeric IP's".  So at least nTopNG should be displaying hostnames.  I ping by hostname and it resolves.

                              1 Reply Last reply Reply Quote 0
                              • M
                                markn62
                                last edited by

                                Does anyone have private IP host overrides in Unbound to know if NtopNG and/or Bandwidthd, within PfSense ver 2.2, will DNS resolve the privates?

                                1 Reply Last reply Reply Quote 0
                                • M
                                  markn62
                                  last edited by

                                  Interestingly, when I packet capture with the "reverse dns lookup" box checked the results for private IP's is x.x.x.x.sae-urn, again numbers with an odd hostname.  So doesn't look like PfSense is using host overrides in Unbound either.  Is this because Unbound is a package in pre ver 2.2?

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

                                    And what do you have pfsense set to use for resolving?  Does it look to itself where you put the over rides in?

                                    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
                                    • M
                                      markn62
                                      last edited by

                                      The General dns server has a Lan Ip entry with gw set to none.  I'm using the Unbound resolver with network interfaces set to Localhost and Lan.  And in Unbound Advanced I have entries, example;
                                      local-data: "host.domain A ip address"
                                      local-data: "host.domain A ip address"

                                      I expected by also choosing localhost along with Lan that internal services could access the resolver via localhost, doesn't appear too.  The names are resolving in an outboard syslog server fine just not internally.

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

                                        In general dns you have pfsense lan IP?

                                        So I don't have any setup in general dns.  In dhcp servers I don't have anything listed - so it hands out the IP of the interface your dhcp server is running on to clients for dns.

                                        If on pfsense I just do a simple drill command it comes back with root hints and shows its using localhost to resolve

                                        ;; Query time: 1 msec
                                        ;; SERVER: 127.0.0.1
                                        ;; WHEN: Fri Feb 20 15:12:48 2015

                                        If I query using drill on cmd line of pfsense for a local host name I have in over rides it resolves just fine.

                                        [2.2-RELEASE][root@pfSense.local.lan]/root: drill i5-w7.local.lan
                                        ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 50574
                                        ;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
                                        ;; QUESTION SECTION:
                                        ;; i5-w7.local.lan.    IN      A

                                        ;; ANSWER SECTION:
                                        i5-w7.local.lan.        3600    IN      A      192.168.1.100

                                        ;; AUTHORITY SECTION:

                                        ;; ADDITIONAL SECTION:

                                        ;; Query time: 1 msec
                                        ;; SERVER: 127.0.0.1
                                        ;; WHEN: Fri Feb 20 15:15:38 2015
                                        ;; MSG SIZE  rcvd: 49

                                        [2.2-RELEASE][root@pfSense.local.lan]/root: drill -x 192.168.1.100
                                        ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 14132
                                        ;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
                                        ;; QUESTION SECTION:
                                        ;; 100.1.168.192.in-addr.arpa.  IN      PTR

                                        ;; ANSWER SECTION:
                                        100.1.168.192.in-addr.arpa.    3600    IN      PTR    i5-w7.local.lan.

                                        ;; AUTHORITY SECTION:

                                        ;; ADDITIONAL SECTION:

                                        ;; Query time: 0 msec
                                        ;; SERVER: 127.0.0.1
                                        ;; WHEN: Fri Feb 20 15:16:34 2015
                                        ;; MSG SIZE  rcvd: 73

                                        When you use the advanced section, I am not sure it creats the PTR?  If you put them in the over ride its doing it as you can see from the above test.  But you say it works from machine that asks pfsense resolver for the host or IP.  So seems to me its just psfsense is not looking to itself.

                                        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
                                        • M
                                          markn62
                                          last edited by

                                          Yes, as I commented, I do have the Lan IP in general, dns. Is this no longer required now that Unbound is integrated from a package as the dns resolver? I have a couple hundred entries so I prefer not to use the GUI override, would be time consuming. I ran the drill command and it resolved from the Lan IP but would not reverse lookup when using localhost.  I have no Dns addy's in Dhcp Server Lan.  With your setup can you resolve from a Lan client to PfSense Lan IP?  I'm running an external syslog server on the Lan subnet and it resolves ok and is pointed to the Lan Ip.

                                          So the settings should be;
                                          General Dns = no entry
                                          Dhcp Server Dns = no entry
                                          Dns Resolver, Network Interfaces = localhost + Lan or just localhost?

                                          2.2-RELEASE][admin@pfsense.host]/root: drill Davidson.host ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 6902 ;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION:
                                          ;; Davidson.host.      IN      A

                                          ;; ANSWER SECTION:
                                          Davidson.host. 3600    IN      A      192.168.150.152

                                          ;; AUTHORITY SECTION:

                                          ;; ADDITIONAL SECTION:

                                          ;; Query time: 0 msec
                                          ;; SERVER: 192.168.2.1
                                          ;; WHEN: Fri Feb 20 14:17:26 2015
                                          ;; MSG SIZE  rcvd: 48
                                          [2.2-RELEASE][admin@pfsense.host]/root: drill -x 192.168.150.152 ;; ->>HEADER<<- opcode: QUERY, rcode: NXDOMAIN, id: 56723 ;; flags: qr aa rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION:
                                          ;; 152.150.168.192.in-addr.arpa.        IN      PTR

                                          ;; ANSWER SECTION:

                                          ;; AUTHORITY SECTION:
                                          168.192.in-addr.arpa.  10800  IN      SOA    localhost. nobody.invalid. 1 3600 1200 604800 10800

                                          ;; ADDITIONAL SECTION:

                                          ;; Query time: 0 msec
                                          ;; SERVER: 127.0.0.1
                                          ;; WHEN: Fri Feb 20 14:17:38 2015
                                          ;; MSG SIZE  rcvd: 105

                                          1 Reply Last reply Reply Quote 0
                                          • M
                                            markn62
                                            last edited by

                                            I took the General, Dns entry out and left all else the same.  The drill command is now reporting the Server is 127.0.0.1.  Resolver is working fine. Still don't know why drill -x IpAddy doesn't produce a reverse lookup, no answer.  Btw, how can you get DHCP Static IP's into the DNS Resolver?  Do they have to be duplicated in the resolver's advanced settings?

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