Unbound not redirecting
-
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 -> enabledadvanced
server:
include: /var/unbound/custom/blocks.confin 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.comThe 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. -
you are asking unbound for the NS of that domain. Your local data is A records..
-
Perhaps read the sticky thread?!
https://forum.pfsense.org/index.php?topic=43835.msg490346#msg490346
-
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. -
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.confit 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.confunbound 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" redirectit 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'