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

    Unbound not redirecting

    Scheduled Pinned Locked Moved DHCP and DNS
    5 Posts 3 Posters 1.8k 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.
    • M
      musicwizard
      last edited by

      i am using 2.2.4-RELEASE (amd64)

      dns resolver -> enabled
      network interface -> ALL
      outgoing network interfaces -> wan
      dnssec -> enabled
      forwarding  ->  disabled(unchecked)
      dhcp registration  -> enabled
      statis dhcp  ->  enabled txt  ->  enabled

      advanced
      server:
      include: /var/unbound/custom/blocks.conf

      in the file i called blocks.conf

      i have
      local-data: "googlesyndication.com A 127.0.0.1"
      local-data: "googleadservices.com A 127.0.0.1"
      local-data: "ads.yahoo.com A 127.0.0.1"
      local-data: "adsonar.com A 127.0.0.1"

      but when i go to a subdomain for example:
      https://tpc.googlesyndication.com/simgad/ some random number what is the link to the add
      it will still show it.

      as i read when you add the main domain the sub domains if they arnt added it should look at the main ones ip which is 127.0.0.1 but it does nto work. i still see the ad.

      when i go to googlesyndication.com i just see a white page.

      When i do
      unbound-control -c /var/unbound/unbound.conf lookup googlesyndication.com

      The following name servers are used for lookup of googlesyndication.com.
      ;rrset 85959 4 0 2 0
      googlesyndication.com.  172359  IN      NS      ns2.google.com.
      googlesyndication.com.  172359  IN      NS      ns1.google.com.
      googlesyndication.com.  172359  IN      NS      ns3.google.com.
      googlesyndication.com.  172359  IN      NS      ns4.google.com.
      ;rrset 85959 1 0 1 0
      ns4.google.com. 172359  IN      A      216.239.38.10
      ;rrset 85959 1 0 1 0
      ns3.google.com. 172359  IN      A      216.239.36.10
      ;rrset 85959 1 0 1 0
      ns1.google.com. 172359  IN      A      216.239.32.10
      ;rrset 85959 1 0 1 0
      ns2.google.com. 172359  IN      A      216.239.34.10
      Delegation with 4 names, of which 4 can be examined to query further addresses.
      It provides 4 IP addresses.
      216.239.34.10          rto 302 msec, ttl 459, ping 2 var 75 rtt 302, tA 0, tAAAA 0, tother 0, EDNS 0 probed.
      216.239.32.10          not in infra cache.
      216.239.36.10          not in infra cache.
      216.239.38.10          not in infra cache.

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

        you are asking unbound for the NS of that domain.  Your local data is A records..

        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

          Perhaps read the sticky thread?!

          https://forum.pfsense.org/index.php?topic=43835.msg490346#msg490346

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

            @doktornotor:

            Perhaps read the sticky thread?!

            https://forum.pfsense.org/index.php?topic=43835.msg490346#msg490346

            i did all that before i posted it.

            i did add the " local-zone:  "example.com"  redirect  " before but it did not work when i add it now it seems to work.
            maybe the service did not restart correctly the last time i tried.

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

              now that it seems to work i used a script to convert a list to the correct format.

              gunzip |
              awk '/^127./{
                      print "local-zone: "" $2 "" redirect"
                      print "local-data: "" $2 " A 127.0.0.1""
              }' > adservers.conf

              it makes a file with all entries in it.
              local-zone: "googleadservices.com" redirect
              local-data: "googleadservices.com A 127.0.0.1"
              local-zone: "googlesyndication.com" redirect
              local-data: "googlesyndication.com A 127.0.0.1"
              local-zone: "gostats.com" redirect
              local-data: "gostats.com A 127.0.0.1"

              which looks good to me but when i add the file to advanced via

              server:
              include: /var/unbound/custom/adservers.conf

              unbound just stops working and i have to remove it from advance again then the service starts again.
              is it possible the list is too big?

              edit:
              when i remove all local-zone: "url" redirect

              it wont stop working and redirect/block does work but it wont work for subdomains as was my initial problem.

              when i check the log it says this.

              php-fpm[49463]: /status_services.php: The command '/usr/local/sbin/unbound -c /var/unbound/unbound.conf' returned exit code '1', the output was '/var/unbound/custom/adblocks.conf:5: error: unknown keyword 'redirect' read /var/unbound/unbound.conf failed: 1 errors in configuration file [1441217056] unbound[61819:0] fatal error: Could not read config file: /var/unbound/unbound.conf'

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