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

    Prevent unbound resolving IPv6 for one domain

    Scheduled Pinned Locked Moved DHCP and DNS
    14 Posts 3 Posters 2.3k 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.
    • GertjanG
      Gertjan @bruor
      last edited by Gertjan

      @bruor said in Prevent unbound resolving IPv6 for one domain:

      The issue I'm seeing through is that since 2.4.5, when enabled, unbound will eat all memory until the firewall locks up.

      7e9e3e24-182e-407f-bbce-f724b88f8f0a-image.png

      I rebooted last Tuesday - one week.
      I'm using that no-aaaa.py script for some .... two years now ?
      Never saw a issue related with memory (or more precise unbound, or unbound using a script).
      The script loads and works fine :

      May 28 08:16:53 	unbound 	18491:0 	info: pythonmod: aaaa script loaded
      

      Can you develop ?

      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
      • M
        mrsunfire @bruor
        last edited by

        @bruor I did this but the module doesn't show up to select. Do I have to reboot the machine?

        Netgate 6100 MAX

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

          No reboot needed.

          Place the file in the /var/unbound directory.
          chmod it to owner unbound:unbound (this might be optional)
          Now, visit the Resolver GUI.

          You should be able to choose :

          b5d94b65-dc6a-4b1a-9316-22dc23a0dce9-image.png

          Note : the file name doesn't mather. It should have a dot py extensuion, and it must be a valid Python file.

          The python file itself needs to be edited : you have to enter the (sub) domain names that need to be filtered.

          ea18c6eb-62a0-45fe-b1ef-340519ccdcc3-image.png

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

          B 1 Reply Last reply Reply Quote 1
          • M
            mrsunfire
            last edited by mrsunfire

            I did this all but not chmod it. I can't select it from the modules menue.

            How to chmod it? Maybe that's the problem?

            Unbenannt.JPG

            Unbenannt2.JPG

            Netgate 6100 MAX

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

              Oops.
              Not "chmod" as the world/group/user right are probably just fine with their default values.
              " -rw-r--r-- ".

              The owner should (?) be changed : keeping it "root" isn't a good idea anyway.

              So, it will be chown.

              Use console, or far better (easier) use SSH, and when you entered, seeing the menu, chose option 8.

              Then :

              [2.4.5-RELEASE][admin@pfsense.brit-hotel-fumel.net]/root: cd /var/unbound/
              [2.4.5-RELEASE][admin@pfsense.brit-hotel-fumel.net]/var/unbound: ls -al netflix- no-aaaa.py
              -rw-r--r--  1 unbound  unbound  1582 May 27 18:14 netflix-no-aaaa.py
              [2.4.5-RELEASE][admin@pfsense.brit-hotel-fumel.net]/var/unbound: chown unbound:unbound netflix-no-aaaa.py
              
              
              Note : mine was already "unbound  unbound".
              

              edit : do yourself a huge favour.
              Never ever use a GUI for these manipulations.
              Some OS'es, like - exemple - Windows, with decades of programming and thousands of engineers might have pulled it of : you can use Explorer to navigate and interact with the file system .... (and still ..... serious intercations need the command line).
              Use the native command line access.
              It's a live saver.

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

                OK I did everything again and now it works! Didn't need to chmod anything.

                Can I just enter for example ".google.com" so that everything with that domain is not resolved in AAAA? So maps.google.com and so on? Or do I need to enter every possible domain?

                Netgate 6100 MAX

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

                  @mrsunfire said in Prevent unbound resolving IPv6 for one domain:

                  maps.google.com and so on?

                  That is :

                  .maps.google.com
                  

                  A sub domain is not the same as a domain name, so yes, ".google.com" won't include the sub domains.

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

                    Ok thanks so far!

                    Netgate 6100 MAX

                    B 1 Reply Last reply Reply Quote 0
                    • B
                      bruor @Gertjan
                      last edited by

                      @Gertjan On my install, if I enter subdomains like you have in the domains list they do not get filtered out. I have to enter them with a trailing "." character for them to be evaluated by the script.

                      domains = [
                          "smtp-relay.gmail.com",
                          "youtube.com.",
                          "googlevideo.com.",
                          "ytimg.com.",
                      #    "netflix.com.",
                      #    "netflix.net.",
                      #    "nflxext.com.",
                      #    "nflximg.net.",
                      #    "nflxvideo.net.",
                      #    "nflxso.net.",
                      ]
                      
                      Non-authoritative answer:
                      Name:    smtp-relay.gmail.com
                      Addresses:  2607:f8b0:4001:c05::1c
                                209.85.144.28
                      

                      However, with the trailing dot on each line, the listed name, and all subdomains appear to be filtered as expected.

                      domains = [
                          "smtp-relay.gmail.com.",
                          "youtube.com.",
                          "googlevideo.com.",
                          "ytimg.com.",
                      #    "netflix.com.",
                      #    "netflix.net.",
                      #    "nflxext.com.",
                      #    "nflximg.net.",
                      #    "nflxvideo.net.",
                      #    "nflxso.net.",
                      ]
                      
                      Non-authoritative answer:
                      Name:    smtp-relay.gmail.com
                      Address:  209.85.144.28
                      
                      Non-authoritative answer:
                      Name:    i.ytimg.com
                      Address:  172.217.164.246
                      
                      1 Reply Last reply Reply Quote 0
                      • B
                        bruor @mrsunfire
                        last edited by

                        @mrsunfire If you make sure that you don't have the "register DHCP leases in the DNS resolver" option enabled you'll experience no issues :)

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

                          I don‘t have this enabled and it works like a charm. :)

                          Netgate 6100 MAX

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