Follow the conversation @ community.ui.com
Please show your thanks by donating to the project using Square Cash or PayPal
We greatly appreciate any and all donations - thank you! Funds go to maintaining development servers and networks.
EdgeMax dnsmasq DNS blacklisting and redirection is inspired by the users at Ubiquiti UISP Community
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.
Fixed Issue #66 documentation issue* Fixed Issue #56 removed large source StevenBlack/hosts as it prevented dnsmasq from starting on ER-X routers
It can be installed using
set service dns forwarding blacklist hosts source githubSteveBlack url 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts'
set service dns forwarding blacklist hosts source githubSteveBlack description 'Blacklists adware and malware websites'
set service dns forwarding blacklist hosts source githubSteveBlack prefix '0.0.0.0 '
configure
set system package repository blacklist components main
set system package repository blacklist description 'Britannic blacklist debian stretch repository'
set system package repository blacklist distribution stretch
set system package repository blacklist url 'https://raw.githubusercontent.com/britannic/debian-repo/master/blacklist/public/'
commit;save;exit
sudo curl -L https://raw.githubusercontent.com/britannic/debian-repo/master/blacklist/public.key | sudo apt-key add -
sudo apt-get update && sudo apt-get install -f edgeos-dnsmasq-blacklist
apt --fix-broken install
curl -L -O https://raw.githubusercontent.com/britannic/blacklist/master/edgeos-dnsmasq-blacklist_1.2.4.9_mips.deb
sudo dpkg -i edgeos-dnsmasq-blacklist_1.2.4.9_mips.deb
sudo apt-get clean cache
delete system image
curl -L -O https://raw.githubusercontent.com/britannic/blacklist/master/edgeos-dnsmasq-blacklist_1.2.4.9_mipsel.deb
sudo dpkg -i edgeos-dnsmasq-blacklist_1.2.4.9_mipsel.deb
sudo apt-get update && sudo apt-get install -f --only-upgrade edgeos-dnsmasq-blacklist
sudo dpkg-reconfigure edgeos-dnsmasq-blacklist
sudo apt-get remove --purge edgeos-dnsmasq-blacklist
configure
set service dns forwarding blacklist disabled true
commit;save;exit
configure
set service dns forwarding blacklist disabled false
commit;save;exit
export DATE=$(date +'%FT%H%M%S'); echo "Backing up blacklist configuration to: /config/user-data/blacklist.${DATE}.cmds"; show configuration commands | grep blacklist > /config/user-data/blacklist.$(date +'%FT%H%M%S').cmds
configure
. /config/user-data/blacklist.[date string].cmds
commit;save;exit
configure
delete service dns forwarding blacklist
. /config/user-data/blacklist.[date string].cmds
commit;save;exit
show configuration commands | match source
grep downloaded /var/log/update-dnsmasq.log
set service dns forwarding blacklist hosts source myhosts description 'Blacklist file source'
set service dns forwarding blacklist hosts source myhosts dns-redirect-ip 0.0.0.0
set service dns forwarding blacklist hosts source myhosts file /config/user-data/blist.hosts.src
gsmtop.net
click.buzzcity.net
ads.admoda.com
stats.pflexads.com
a.glcdn.co
wwww.adleads.com
ad.madvertise.de
apps.buzzcity.net
ads.mobgold.com
android.bcfads.com
req.appads.com
show.buzzcity.net
api.analytics.omgpop.com
r.edge.inmobicdn.net
www.mmnetwork.mobi
img.ads.huntmad.com
creative1cdn.mobfox.com
admicro2.vcmedia.vn
admicro1.vcmedia.vn
The update-dnsmasq binary checks for an active configuration in the following locations:
If no configuration is found, update-dnsmasq will remove any dnsmasq blocklists it previously created
configure
delete service dns forwarding blacklist domains source malc0de
delete service dns forwarding blacklist hosts source yoyo.org
commit;save;exit
# No Coin Filter List #
# https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt #
# Last updated: Mon, 04 Dec 17 19:18:42 +0000 #
127.0.0.1 localhost
127.0.0.1 0koryu0.easter.ne.jp
127.0.0.1 109-204-26-16.netconnexion.managedbroadband.co.uk
127.0.0.1 1866809.securefastserver.com
configure
set service dns forwarding blacklist hosts source nocoinfilterlist description '127.0.0.1 based host and domain list'
set service dns forwarding blacklist hosts source nocoinfilterlist prefix '127.0.0.1 '
set service dns forwarding blacklist hosts source nocoinfilterlist url 'https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt'
commit;save;exit
configure
set service dns forwarding blacklist exclude cdn.visiblemeasures.com
set service dns forwarding blacklist include www.nastywebsites.com
commit;save;exit
configure
set service dns forwarding blacklist domains exclude visiblemeasures.com
set service dns forwarding blacklist domains include domainsnastywebsites.com
set service dns forwarding blacklist hosts exclude cdn.visiblemeasures.com
set service dns forwarding blacklist hosts include www.nastywebsites.com
commit;save;exit
server=/www.bing.com/#
address=/bing.com/#
set system task-scheduler task update_blacklists executable arguments 10800
set system task-scheduler task update_blacklists executable path /config/scripts/update-dnsmasq-cronjob.sh
set system task-scheduler task update_blacklists executable arguments 10800
set system task-scheduler task update_blacklists interval 1d
set system task-scheduler task update_blacklists interval 6h
/config/scripts/update-dnsmasq -h
-dir string
Override dnsmasq directory (default "/etc/dnsmasq.d")
-f <file>
<file> # Load a config.boot file
-h Display help
-safe
Fail over to /config/user-data/blacklist.failover.cfg
-v Verbose display
-version
configure
set service dns forwarding cache-size 2048
set service dns forwarding except-interface [Your WAN i/f]
set service dns forwarding name-server [Your choice of IPv4 Internet Name-Server]
set service dns forwarding name-server [Your choice of IPv4 Internet Name-Server]
set service dns forwarding name-server [Your choice of IPv6 Internet Name-Server]
set service dns forwarding name-server [Your choice of IPv6 Internet Name-Server]
set service dns forwarding options bogus-priv
set service dns forwarding options domain-needed
set service dns forwarding options domain=mydomain.local
set service dns forwarding options enable-ra
set service dns forwarding options expand-hosts
set service dns forwarding options localise-queries
set service dns forwarding options strict-order
set service dns forwarding system
set system name-server 127.0.0.1
set system name-server '::1'
commit; save; exit
tail /var/log/update-dnsmasq.log
Total entries extracted = Total sites blocked
Timestamp = Last time the update ran
sudo /config/scripts/update-dnsmasq -v
grep [host.domain.tld] /etc/dnsmasq.d/*
grep [domain.tld] /etc/dnsmasq.d/*
Note: If the domain/hostname is manually excluded it will appear in one of the *.whitelisted-*.conf files
Display installed edgeos-dnsmasq-blacklist version:
sudo /config/scripts/update-dnsmasq -version