How To Add Local blacklist.txt to Adblock? (Samba URL?)


terrelsa13

Serious Server
Member
I am trying to add my own local blacklist file to the Adblock page.

It looks like I should be able to add a new entry using a samba url (last row).
tItdC4i.png


But the logs show an error finding this URL.
Code:
Sep  8 23:38:37 CYBERTRON user.info adblock: [6] downloading blacklist - https://raw.githubusercontent.com/WindowsLies/BlockWindows/master/hosts
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: query[AAAA] raw.githubusercontent.com from 127.0.0.1
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: forwarded raw.githubusercontent.com to 127.0.0.1
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: validation result is INSECURE
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: reply raw.githubusercontent.com is <CNAME>
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: reply github.map.fastly.net is NODATA-IPv6
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: query[AAAA] github.map.fastly.net from 127.0.0.1
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: cached github.map.fastly.net is NODATA-IPv6
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: query[A] raw.githubusercontent.com from 127.0.0.1
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: cached raw.githubusercontent.com is <CNAME>
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: forwarded raw.githubusercontent.com to 127.0.0.1
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: validation result is INSECURE
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: reply raw.githubusercontent.com is <CNAME>
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: reply github.map.fastly.net is 151.101.112.133
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: query[A] raw.githubusercontent.com from 127.0.0.1
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: cached raw.githubusercontent.com is <CNAME>
Sep  8 23:38:37 CYBERTRON daemon.info dnsmasq[11054]: cached github.map.fastly.net is 151.101.112.133
Sep  8 23:38:38 CYBERTRON user.info adblock: ... [6] found 109 entries
Sep  8 23:38:38 CYBERTRON user.info adblock: skip disabled blacklist - https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/social/hosts
Sep  8 23:38:38 CYBERTRON user.info adblock: [7] downloading blacklist - smb://hieroglyph/public/adblock/blacklist.txt
Sep  8 23:38:38 CYBERTRON user.info adblock: ... [7] download error! Please check URL

I do not think it is a permissions issue as I use this particular folder as the guest "storage space". And it is accessible from a different machine.
rkaTsIK.png

ZU6AZnt.png

35jzjqT.png


I can confirm the domains in this blacklist.txt file can still be reached after I get the above error.

I also tried putting the blacklist.txt file in the /opt/ folder on the usb stick plugged into the router. And putting the path to the blacklist.txt file a couple different ways. They both return the same download error.
kVb4Mfa.png

X7vDw90.png


File path on router in /opt/ folder.
3PMvOo3.png



Info: I know I can add the domains to the "Blacklisted Domains" text box. But I would like to move these into a text file.

This is the contents of my blacklist file for now. More will be added to it once I can get this simple one working.
Code:
#########################################
# Custom Adblock List
127.0.0.1 localhost #IPv4 localhost
::1 localhost #IPv6 localhost
#########################################
127.0.0.1       collegehumor.com
127.0.0.1       funnyordie.com
127.0.0.1       textsfromlastnight.com


Is there a way to add your own local blacklist file? What am I missing?
 
I don't use adblock, but the error in the log you posted implies either the URL format is invalid, or that connecting to smb://yoursite as a website failed.. sense the error response still called it a URL. Either case would mean having smb: instead of http: is not a recognized syntax by adblock to indicate a network share location rather than a web URL. IE: using the wrong ports. May be worth trying file:// instead.
 
Last edited:
I don't use adblock, but the error in the log you posted implies either the URL format is invalid, or that connecting to smb://yoursite as a website failed.. sense the error response still called it a URL. Either case would mean having smb: instead of http: is not a recognized syntax by adblock to indicate a network share location rather than a web URL.
Thank you Sean B. I was hoping I was doing something wrong.

But this still leaves my original question unanswered:
Is there a way to add your own local blacklist file?
 
Thank you Sean B. I was hoping I was doing something wrong.

But this still leaves my original question unanswered:
Sorry, I forgot to put in my suggestion. I edited the post to include it, which was to try file:// instead.
 
Unfortunately, I was not able to get file:// to work for me. All of my attempts returned the same error as before.

Original Paths
Router File Path: /opt/adblock/blacklist.txt
Server File Path: /media/Sphinx/Public/adblock/blacklist.txt
Server SMB URL: smb://172.31.13.123/Public/adblock/blacklist.txt

Unsuccessful File:// URL Attempts
file://opt/adblock/blacklist.txt
file:///opt/adblock/blacklist.txt
file://172.31.13.10/opt/adblock/blacklist.txt
file:///172.31.13.10/opt/adblock/blacklist.txt
file://172.31.13.123/media/Sphinx/Public/adblock/blacklist.txt
file:///172.31.13.123/media/Sphinx/Public/adblock/blacklist.txt
file://172.31.13.123/Public/adblock/blacklist.txt
file:///172.31.13.123/Public/adblock/blacklist.txt

  • Router IP 172.31.13.10
  • Server IP 172.31.13.123
  • Router hostname cybertron
  • Server hostname hieroglyph
 
Unfortunately, I was not able to get file:// to work for me. All of my attempts returned the same error as before.

Original Paths
Router File Path: /opt/adblock/blacklist.txt
Server File Path: /media/Sphinx/Public/adblock/blacklist.txt
Server SMB URL: smb://172.31.13.123/Public/adblock/blacklist.txt

Unsuccessful File:// URL Attempts
file://opt/adblock/blacklist.txt
file:///opt/adblock/blacklist.txt
file://172.31.13.10/opt/adblock/blacklist.txt
file:///172.31.13.10/opt/adblock/blacklist.txt
file://172.31.13.123/media/Sphinx/Public/adblock/blacklist.txt
file:///172.31.13.123/media/Sphinx/Public/adblock/blacklist.txt
file://172.31.13.123/Public/adblock/blacklist.txt
file:///172.31.13.123/Public/adblock/blacklist.txt

  • Router IP 172.31.13.10
  • Server IP 172.31.13.123
  • Router hostname cybertron
  • Server hostname hieroglyph
None of those are the same as the URL in this screenshot you posted to show the file is accessible from other machines:

35jzjqT.png


So, if that screenshot indeed shows that the file and its location are accessible from other clients on the network.. the line to correctly try file:// with would be:

file://hieroglyph/public/adblock/blacklist.txt

as the URL needs to correctly represent the hostname and path of the file as seen by the network. Not a local /opt path etc. File:// may indeed not work, but don't chase your tail by not using a known working network path.
 
None of those are the same as the URL in this screenshot you posted to show the file is accessible from other machines:

35jzjqT.png


So, if that screenshot indeed shows that the file and its location are accessible from other clients on the network.. the line to correctly try file:// with would be:

file://hieroglyph/public/adblock/blacklist.txt

as the URL needs to correctly represent the hostname and path of the file as seen by the network. Not a local /opt path etc.

Are you saying I cannot use the IP address of the machine and must use the hostname?

I show at the bottom of my last post, the server hostname hieroglyph has the IP 172.31.13.123.
 
Are you saying I cannot use the IP address of the machine and must use the hostname?

I show at the bottom of my last post, the server hostname hieroglyph has the IP 172.31.13.123.
That's exactly what I'm saying. The network share path is not the same as a network IP or hostname, more specifically it is a designation made within the SMB protocol.. and using an IP in place of the share path will not work. Remember, you're not using a network browser, you're using a web browser. Try it using the IP in the same way you made the screenshot. I think you'll find it fails.
 
That's exactly what I'm saying. The network share path is not the same as a network IP or hostname, more specifically it is a designation made within the SMB protocol.. and using an IP in place of the share path will not work. Try it using the IP in the same way you made the screenshot. I think you'll find it fails.

I've never had that problem before. It works the same using the hostname or the IP for me.
Ignore the script I added to the folder.
FNJLhui.png


But just to be sure. I tried using the hostname and get the same error.
 
I've never had that problem before. It works the same using the hostname or the IP for me.
Ignore the script I added to the folder.
FNJLhui.png


But just to be sure. I tried using the hostname and get the same error.
That is not a web browser, and therefor not a URL, hence not the same way you tried it in the screenshot. If you wish to see what I mean, try it in a web browser as you were accessing it before. Changing your process of doing things as you're trying to track a problem is very bad practice in terms of diagnostics. But, a moot point if you did in fact try file:// with the network path as shown in the screenshot I referenced and it didn't work. I'll see if I can track down any other possibilities for you.
 
That is not a web browser, and therefor not a URL, hence not the same way you tried it in the screenshot. If you wish to see what I mean, try it in a web browser as you were accessing it before. Changing your process of doing things as you're trying to track a problem is very bad practice in terms of diagnostics. But, a moot point if you did in fact try file:// with the network path as shown in the screenshot I referenced and it didn't work. I'll see if I can track down any other possibilities for you.

You are right. And I have learned something: Neither smb url will work in the web browser until it is opened in the file manager. This may be a clue as to why adblock in the router is returning a "download error".

So when accessing smb://172.31.13.123/Public/adblock/ in the file manager I can also open the blacklist.txt file it in a web browser.
Same for when accessing smb://hieroglyph/Public/adblock/ in the file manager, only then can blacklist.txt be opened in the web browser.
y0BZgj3.png


To be more clear here. I have to open the smb url in the file manager before I can open it in the web browser.

Thanks!
 
You are right. And I have learned something: Neither smb url will work in the web browser until it is opened in the file manager. This may be a clue as to why adblock in the router is returning a "download error".

So when accessing smb://172.31.13.123/Public/adblock/ in the file manager I can also open the blacklist.txt file it in a web browser.
Same for when accessing smb://hieroglyph/Public/adblock/ in the file manager, only then can blacklist.txt be opened in the web browser.
y0BZgj3.png


To be more clear here. I have to open the smb url in the file manager before I can open it in the web browser.

Thanks!
I'd say something isn't quite right with either the share permissions or samba config. You should be able to access the file by using the full and correctly formatted share path via a web browser without having to establishing a connection with file manager first.
 
I'd say something isn't quite right with either the share permissions or samba config. You should be able to access the file by using the full and correctly formatted share path via a web browser without having to establishing a connection with file manager first.

I am using the Samba graphical configuration tool. Here is my samba config:
https://pastebin.com/xHZTev8F

The Public folder of this samba share has recursively been set with 777 permissions and nobody:nogroup ownership.
 
I am using the Samba graphical configuration tool. Here is my samba config:
https://pastebin.com/xHZTev8F

The Public folder of this samba share has recursively been set with 777 permissions and nobody:nogroup ownership.
That is your actual samba config file, and not still the default example config?


And what is your network configuration?
IE:

Is there a domain or active directory for the network?

Is there a WINS server on the network?

Any other routers or relays in between clients/server and the router running samba?
 
I don't see any shares in that config which would correspond to the hieroglyph URL that has been used in the screenshots.. so I'm going to assume this is the one that would be used as it's the only Public folder path.

Code:
[Public]
    comment = Public Share
    path = /media/Sphinx/Public
    writeable = yes
;   browseable = yes
    guest ok = yes

Remove the ; from the "browseable = yes" line. If there's not already a WINS server on the network, and as long it wouldnt be a conflict/compatibility issue with your network configuration, enable nmbd to be a WINS server on the network by removing the # from this line and changing no to yes:

Code:
#   wins support = no

Then, in the routers web interface goto Basic->Network and put the IP address of that machine in the box for "WINS (for DHCP)". Make sure all the clients renew their DHCP leases, either manually or via reboot.
 
Last edited:
Is there a domain or active directory for the network?

Is there a WINS server on the network?
I am not sure what these are or what they are used for. So I have not set anything like this up.
If they come turned on by default in Linux Mint 17.3 or Shibby v140, they still have the default settings.

Any other routers or relays in between clients/server and the router running samba?
I do have routers setup as access points for wifi. They do not act as dhcp servers. I used this link to configure them as APs.
http://www.linksysinfo.org/index.ph...router-a-dumb-access-point.37403/#post-182212

Router is not running samba. The samba share is running on a desktop (hieroglyph) running Linux Mint 17.3.
The desktop is directly connected to a switch which is connected to the router (cybertron).

The blacklist.txt file is in two places.
First place is the router located here: /opt/adblock/blacklist.txt
Second place is the desktop located here: /media/Sphinx/Public/adblock/blacklist.txt

Remove the ; from the "browseable = yes" line and try accessing the file again from a web browser without connecting from file manager.
It's really late here. I'll have to continue tomorrow.
I will reply when I remove the semi colon from in front of browseable=yes in the samba config file and give it a try.
 
Should have verified this before, but when you access the share from file manager it's not asking for a login/password correct? And a login/password hasn't been "remembered" by file manager that you forgot about?
 
adblock fetch its database using wget which only support http/s and ftp (not sure if wget busybox supports ftp) and there's no easy way to do it.

so there's 2 way to have your own blacklist, which 1 add it on dnsmasq, or host it using tomato's builtin apache server or maybe using the builtin httpd (which what tomato uses for its tomato web admin page).
 

Back
Top