britannic/blacklist

Possible to Include TLDs

mygeek911 opened this issue · 3 comments

Is it possible to include TLDs as well? I've tried creating a new domain file with some problematic TLDs and it seems that they get dropped. (They are never downloaded/created to the /etc/dnsmasq.d/ folder.) The hosts file I created and played with works without any problems.

Please provide an example of the use case you're attempting to solve and configuration.

Hi britannic,

Thanks for checking in on this. Let's say I create the following TLD block list.
# TLDs to block
fit
gdn
ryukyu

I save it on a web server at hxxp://www.mydomainlist.com/tld.txt.

Then I configure the blacklist with the following commands:
configure
set service dns forwarding blacklist domains source myTLDs description 'Blacklist top-level domains'
set service dns forwarding blacklist domains source myTLDs url 'hxxp://www.mydomainlist.com/tld.txt'
commit;save;exit

I expect to see, but can't locate, a domains.myTLDs.blacklist.conf in the /etc/dnsmasq.d/ folder.

In the past, I've blocked top-level domains before with the example provided here and using a file like this one. It has worked well for a couple of years.
# TLDs to block
address=/fit/0.0.0.0
address=/gdn/0.0.0.0
address=/ryukyu/0.0.0.0

I'm just hoping to switch over to your program completely.

@mygeek911, thanks for the detail. TLD redirection is supported by dnsmasq, so this will be an enhancement request, since the current program logic is set up to detect TLD + subdomain at a minimum. You're welcome to make a pull request and submit code changes if you need it quickly. If you only have a few TLDs to redirect, it may be simpler to just maintain the dnsmasq file using the task scheduler with your web server.