├── .github └── FUNDING.yml ├── LICENSE ├── README.md ├── domains ├── optional-list.txt ├── referral-sites.txt └── whitelist.txt ├── images ├── logo.png ├── paypal.png ├── uninstall.gif ├── upi.png └── whitelist.gif └── scripts ├── domains.sql ├── referral.sh ├── uninstall.py └── whitelist.py /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | liberapay: Anudeep 3 | custom: https://paypal.me/anudeepnd 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Anudeep ND 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | Whitelist logo 3 |
4 | 5 |
6 | 7 | 8 |
9 | 10 | repo size 11 | 12 | 13 | repo size 14 | 15 | 16 | stars 17 | 18 | 19 | last updated 20 | 21 | 22 | commit activity 23 | 24 | 25 | open issues 26 | 27 | 28 | closed issues 29 | 30 | 31 | contributors 32 | 33 | 34 | license 35 | 36 |
37 | 38 |
39 |

Collection of commonly white listed domains for
Pi-Hole®

40 |
41 | 42 | 43 |
44 | 45 | A robust collection of commonly white listed websites borrowed from various sources including Pi-Hole subreddit, Pi-Hole forum, Pi-Hole GitHub repository and more! 46 | Add these domains to your Pi-Hole setup by running a script or manually and make your setup __trouble-free!__ 47 | Want to report a new domain? Want to report existing one? Feel free to file an [issue](https://github.com/anudeepND/whitelist/issues). 48 | 49 |
50 | 51 |
52 |

53 | 54 | Releases 55 | 56 | | 57 | 58 | Pulse 59 | 60 | | 61 | 62 | Submit Issue 63 | 64 | | 65 | 66 | Submit PR 67 | 68 | | 69 | 70 | Donate 71 | 72 |

73 |
74 |   75 | 76 |
77 | 78 | ![Whitelist install demo gif](https://raw.githubusercontent.com/anudeepND/whitelist/master/images/whitelist.gif) 79 | 80 |
81 | 82 | ## Table of contents 83 | - [Features](#features) 84 | - [Overview](#overview) 85 | - [Installation](#installation) 86 | * [For whitelist.txt](#for-whitelisttxt) 87 | * [For referral-sites.txt](#for-referral-sitestxt) 88 | * [For optional-list.txt](#for-optional-listtxt) 89 | * [For Docker installation (with Python3 support)](#for-docker-installation-with-python3-support) 90 | * [For Docker installation (without Python3 support) or /etc/pihole on different directory](#for-docker-installation-without-python3-support-or-etcpihole-on-different-directory) 91 | - [Uninstall](#uninstall) 92 | - [Automated Update](#automated-update) 93 | - [How do I determine an ad domain?](#how-do-i-determine-an-ad-domain) 94 | - [Stargazers over time ](#stargazers-over-time) 95 | - [Support](#support) 96 | - [License ](#license) 97 | 98 | ## Features 99 | 100 | - The entire repo is curated. 101 | - New domains are added frequently. 102 | - Supports Pi-Hole Docker installation. 103 | - Comes with a simple install/uninstall scripts i.e. you can add all domains with comments automatically at an instant. 104 | - Domains are categorized and are included in 3 different files. 105 | - All the domains will have comments to let you know about the domain. 106 | - If you are a beginner to Pi-Hole, adding these sites will solve issues with host files that block legit websites. 107 | 108 | ## Overview 109 |
110 | 111 | | File Name | Domain Count | Description | Update Frequency | Raw Link | 112 | |:-:|:-:|:-:|:-:|:-:| 113 | | whitelist.txt | 191 | This file contain domains that are __safe__ to whitelist i.e. it does not contain any tracking or advertising sites. Adding this file fixes many problems like YouTube watch history, videos on news sites and so on. If you want to report additional domain feel free to file an [issue](https://github.com/anudeepND/whitelist/issues). | Occasionally | [link](https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt) | 114 | | referral-sites.txt | 75 | People who use services like Slickdeals and Fatwallet needs a few sites (most of them are either trackers or ads) to be whitelisted to work properly. This file contains some analytics and ad serving sites like __doubleclick.net__ and others. __If you don't know what these services are, stay away from this list.__ | Occasionally | [link](https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/referral-sites.txt) | 115 | | optional-list.txt | -- | This file contain domains that are needed to be whitelisted depending on the service you use. It may contain some tracking site but sometimes it's necessary to add bad domains to make a few services to work. Currently there is no script for this list, you have to add domains manually to your Pi-Hole. | Occasionally | [link](https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/optional-list.txt) | 116 | 117 | 118 | ## Installation 119 | 120 | Make sure you have __python3__ installed on your machine. You can simply install it by using `sudo apt install python3` 121 | 122 | #### For whitelist.txt 123 | 124 | ```Shell 125 | git clone https://github.com/anudeepND/whitelist.git 126 | sudo python3 whitelist/scripts/whitelist.py 127 | ``` 128 | 129 | #### For referral-sites.txt 130 | 131 | ```Shell 132 | git clone https://github.com/anudeepND/whitelist.git 133 | cd whitelist/scripts 134 | sudo ./referral.sh 135 | ``` 136 | 137 | If you are using Pi-hole 5.0 or later, the comment field has a unique string - `qjz9zk` to uniquely identify the domains added by this script so the user can remove the domains without affecting other whitelisted sites. 138 | 139 | #### For optional-list.txt 140 | You can add it manually depending upon the service you use. 141 | 142 | #### For Docker installation (with Python3 support) 143 | 144 | Access you running Pi-Hole container by `docker exec -it bash` and proceed with the steps given below: 145 | 146 | ```Shell 147 | git clone https://github.com/anudeepND/whitelist.git 148 | sudo python3 whitelist/scripts/whitelist.py 149 | ``` 150 | 151 | ```Shell 152 | git clone https://github.com/anudeepND/whitelist.git 153 | cd whitelist/scripts 154 | sudo ./referral.sh 155 | ``` 156 | 157 | #### For Docker installation (without Python3 support) or /etc/pihole on different directory 158 | 159 | You can pass two optional arguments to whitelist.py, uninstall.py, and referral.sh: 160 | 161 | ```Text 162 | -d or --dir to specify the Pi-hole etc directory (in normal install should be /etc/pihole) 163 | -D or --docker to specify if Pi-hole is running as Docker container 164 | ``` 165 | 166 | ```Shell 167 | git clone https://github.com/anudeepND/whitelist.git 168 | sudo python3 whitelist/scripts/whitelist.py --dir /home/docker/pihole/etc-pihole/ --docker 169 | ``` 170 | 171 | ```Shell 172 | git clone https://github.com/anudeepND/whitelist.git 173 | cd whitelist/scripts 174 | sudo ./referral.sh --dir /home/docker/pihole/etc-pihole/ --docker 175 | ``` 176 | __Note: You don't have to clone the repo every time you need to update whitelist file. Navigate to `whitelist/scripts` and run it again `sudo python3 whitelist.py__ 177 | 178 | ## Uninstall 179 | 180 | ![Whitelist uninstall demo gif](https://raw.githubusercontent.com/anudeepND/whitelist/master/images/uninstall.gif) 181 | 182 | As mentioned earlier, the unique string (`qjz9zk`) will come in handy while removing the domains from the database. It uses LIKE operator of the SQLite to match the wildcard string present in the comment section. 183 | 184 | ```SQL 185 | DELETE FROM domainlist WHERE type = 0 AND comment LIKE '%qjz9zk%' 186 | ``` 187 | 188 | This statement will remove the domain only if it is present in the exact whitelist section and having the string `qjz9zk`. Domains in the regex list will not be removed by this script. 189 | 190 | The older version of the Pi-hole uses a simple text file to store the entries. In this case the script will match the domains present in your Pi-hole to the domains present in the GitHub repo and removes them accordingly. 191 | 192 | __To remove the domains:__ 193 | `sudo python3 uninstall.py` 194 | 195 | 196 | ## Automated Update 197 | 198 | ```Shell 199 | cd /opt/ 200 | sudo git clone https://github.com/anudeepND/whitelist.git 201 | ``` 202 | 203 | Make the script to run the script at 1AM on the last day of the week 204 | 205 | ```Shell 206 | sudo nano /etc/crontab 207 | ``` 208 | 209 | Add this line at the end of the file: 210 | 211 | ```Text 212 | 0 1 * * */7 root /opt/whitelist/scripts/whitelist.py 213 | ``` 214 | 215 | CTRL + X then Y and Enter 216 | 217 | ```Shell 218 | sudo python3 whitelist/scripts/whitelist.py 219 | ``` 220 | 221 | ## How do I determine an ad domain? 222 | - __Adam:ONE Assistant (formerly DNSthingy Assistant):__ This browser extension will list all of the domains that are queried when a web page is loaded. You can often look at the list of domains and cherry pick the ones that appear to be ad-serving domains. 223 | - __Using inbuilt Developer tool:__ For Chrome and Firefox, __`ctrl+shift+I`__ will land you in Developer tools menu. 224 | - __Using an Android app:__ [__`Net Guard`__](https://play.google.com/store/apps/details?id=eu.faircode.netguard) is an Android app that can be used to monitor any specific apps, works on unrooted devices too. 225 | 226 | 227 | ## Stargazers over time 228 |
229 | 230 | [![Stargazers over time](https://starchart.cc/anudeepND/whitelist.svg)](https://starchart.cc/anudeepND/whitelist) 231 | 232 | ## Support 233 | Maintaining an quality open-source takes a lot of time. I have been contributing to this project over 3 years. Your support will help me to keep the project running and provide you quality service. You can also donate using UPI enabled apps such as __`PhonePe`__, __`Google Pay`__, __`Paytm`__ and more! (UPI ID: anudeepnd@ybl). If you have any queries related to PayPal or donation, you can send a DM to me on [`Twitter`](https://twitter.com/anudeepnd). 234 |
235 | Donate using Paypal 236 |   237 |   238 | Donate using UPI apps 239 |
240 | 241 | ## License 242 | 243 | ```Text 244 | MIT License 245 | 246 | Copyright (c) 2020 Anudeep ND 247 | 248 | Permission is hereby granted, free of charge, to any person obtaining a copy 249 | of this software and associated documentation files (the "Software"), to deal 250 | in the Software without restriction, including without limitation the rights 251 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 252 | copies of the Software, and to permit persons to whom the Software is 253 | furnished to do so, subject to the following conditions: 254 | 255 | The above copyright notice and this permission notice shall be included in all 256 | copies or substantial portions of the Software. 257 | 258 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 259 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 260 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 261 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 262 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 263 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 264 | SOFTWARE. 265 | ``` 266 | -------------------------------------------------------------------------------- /domains/optional-list.txt: -------------------------------------------------------------------------------- 1 | # Contributed by Anudeep 2 | # Project home page: https://github.com/anudeepND/whitelist 3 | # Licence: https://github.com/anudeepND/whitelist/blob/master/LICENSE 4 | 5 | # Adult Swim Videos on Amazon Firestick 6 | pmd.cdn.turner.com 7 | i.cdn.turner.com 8 | s.cdn.turner.com 9 | z.cdn.turner.com 10 | amd.cdn.turner.com 11 | 12 | # Amazon Alexa and Amazon Shopping app 13 | device-metrics-us-2.amazon.com 14 | device-metrics-us.amazon.com 15 | 16 | # Amazon Kindle 17 | cognito-identity.us-east-1.amazonaws.com 18 | unagi-na.amazon.com 19 | ocsp.rootg2.amazontrust.com 20 | det-ta-g7g.amazon.com 21 | todo-ta-g7g.amazon.com 22 | device-messaging-na.amazon.com 23 | s3-eu-west-1.amazonaws.com 24 | us-east-1.amazonaws.com 25 | 26 | # Amazon AWS (???) - whitelist to make Kryptonite work 27 | sqs.us-east-1.amazonaws.com 28 | 29 | # Bild.de 30 | acdn.adnxs.com 31 | cdn1.smartadserver.com 32 | ec-ns.sascdn.com 33 | 34 | # DirectTV Now 35 | js.maxmind.com 36 | directvnow.com 37 | directvapplications.hb.omtrdc.net 38 | s.zkcdn.net 39 | 40 | # Facebook 41 | creative.ak.fbcdn.net 42 | external-lhr0-1.xx.fbcdn.net 43 | external-lhr10-1.xx.fbcdn.net 44 | external-lhr1-1.xx.fbcdn.net 45 | external-lhr2-1.xx.fbcdn.net 46 | external-lhr3-1.xx.fbcdn.net 47 | external-lhr4-1.xx.fbcdn.net 48 | external-lhr5-1.xx.fbcdn.net 49 | external-lhr6-1.xx.fbcdn.net 50 | external-lhr7-1.xx.fbcdn.net 51 | external-lhr8-1.xx.fbcdn.net 52 | external-lhr9-1.xx.fbcdn.net 53 | fbcdn-creative-a.akamaihd.net 54 | graph.facebook.com 55 | graph.instagram.com 56 | instagram.c10r.facebook.com 57 | scontent-lhr3-1.xx.fbcdn.net 58 | scontent.xx.fbcdn.net 59 | scontent.fgdl5-1.fna.fbcdn.net 60 | facebook.com 61 | facebook.net 62 | fbcdn.net 63 | cdn.fbsbx.com 64 | edge-mqtt.facebook.com 65 | 0-edge-chat.facebook.com 66 | 1-edge-chat.facebook.com 67 | 2-edge-chat.facebook.com 68 | 3-edge-chat.facebook.com 69 | 4-edge-chat.facebook.com 70 | 5-edge-chat.facebook.com 71 | 6-edge-chat.facebook.com 72 | edge-chat.facebook.com 73 | mqtt-mini.facebook.com 74 | 75 | # Fix - Images not loading on www.thecut.com 76 | pixel.nymag.com 77 | 78 | # GeForce Experience 79 | events.gfe.nvidia.com 80 | gfwsl.geforce.com 81 | 82 | # GTA Online telemetry. Whitelist this domain to prevent the game from crashing. 83 | prod.telemetry.ros.rockstargames.com 84 | 85 | # Host files 86 | hosts-file.net 87 | raw.githubusercontent.com 88 | v.firebog.net 89 | hostsfile.org 90 | someonewhocares.org 91 | hostsfile.mine.nu 92 | winhelp2002.mvps.org 93 | sysctl.org 94 | pgl.yoyo.org 95 | zeustracker.abuse.ch 96 | 97 | # Images not loading on aliexpress.com 98 | ae01.alicdn.com 99 | 100 | # Jackbox.tv 101 | www.google-analytics.com 102 | google-analytics.com 103 | ssl.google-analytics.com 104 | 105 | # Lotus talk 106 | lotustalk.com 107 | www.lotustalk.com 108 | 109 | # National Express, UK (nationalexpress.com/en) - Unable to book journey 110 | cdns.gigya.com 111 | 112 | # Netflix - Domains needed for netlix to work correctly 113 | api-global.netflix.com 114 | appboot.netflix.com 115 | secure.netflix.com 116 | 117 | # NowTV UK - AppleTV 118 | dpm.demdex.net 119 | 120 | # Nvidia updates 121 | ota-downloads.nvidia.com 122 | 123 | # Pluto.tv 124 | images.pluto.tv 125 | stitcher.pluto.tv 126 | siloh.pluto.tv 127 | silo.pluto.tv 128 | cdn-mobile.api.pluto.tv 129 | api.pluto.tv 130 | players.pluto.tv 131 | 132 | # Roku HGTV app: Failed to play previous episodes 133 | dcs-vod.apis.anvato.net 134 | 135 | # Roku TNT app: Failed to play videos 136 | z.cdn.turner.com 137 | manifest.auditude.com 138 | 139 | # Refersion.com (affiliate marketing) 140 | cdn.refersion.com 141 | refersion.com 142 | www.refersion.com 143 | 144 | # Roku TV CW and NBC app 145 | cwtv-mrss-akamai.cwtv.com 146 | cwtv-prod-elb.digitalsmiths.net 147 | redirector.googlevideo.com 148 | 149 | # Samsung TV's Amazon Prime Video app 150 | time.samsungcloudsolution.com 151 | 152 | # Samsung smart TV's network issue 153 | cdn.samsungcloudsolution.com 154 | 155 | # SBS Online videos not playing 156 | www.sbs.com.au 157 | sbs.com.au 158 | api.sbs.com.au 159 | media.sbs.com.au 160 | resources.sbs.com.au 161 | videocdn-sbs.akamaized.net 162 | sbsvodns-vh.akamaihd.net 163 | link.theplatform.com 164 | e7065.e2.akamaiedge.net 165 | a463.w10.akamai.net 166 | a790.w16.akamai.net 167 | 168 | # Share buttons on websites 169 | dsms0mj1bbhn4.cloudfront.net 170 | shareaholic.com 171 | 172 | # Sky Go (skygo.sky.de) 173 | assets.adobedtm.com 174 | 175 | # Spotify premium with Denon Heos speakers 176 | # https://github.com/anudeepND/whitelist/issues/93 177 | mobile-ap.spotify.com 178 | apresolve.spotify.com 179 | upgrade.scdn.com 180 | market.spotify.com 181 | spclient.wg.spotify.com 182 | audio-ake.spotify.com.edgesuite.net 183 | 184 | # Target's Weekly Ads 185 | weeklyad.target.com 186 | m.weeklyad.target.com 187 | weeklyad.target.com.edgesuite.net 188 | 189 | # UK University application website 190 | # https://github.com/anudeepND/whitelist/issues/30 191 | track.ucas.com 192 | 193 | # URL shorteners 194 | t.ly 195 | adf.ly 196 | www.adf.ly 197 | bit.ly 198 | www.bit.ly 199 | goo.gl 200 | ow.ly 201 | www.ow.ly 202 | amzn.to 203 | amzn.com 204 | 205 | # Videos not playing on arstechnica/wired/vogue/newyorker 206 | # Note: ads before videos may appear after whitelisting this domain 207 | d2c8v52ll5s99u.cloudfront.net 208 | 209 | # Videos not playing on www.jacquielawson.com 210 | f1.media.brightcove.com 211 | 212 | # WatchESPN 213 | fpdownload.adobe.com 214 | entitlement.auth.adobe.com 215 | livepassdl.conviva.com 216 | 217 | # Xbox Achievements and game stats sync 218 | v10.events.data.microsoft.com 219 | v20.events.data.microsoft.com 220 | 221 | # streamelements.com (Blocked by Pi-hole regex) 222 | stats.streamelements.com 223 | 224 | # Adobe licence verification endpoints 225 | lm.licenses.adobe.com 226 | activate.adobe.com 227 | -------------------------------------------------------------------------------- /domains/referral-sites.txt: -------------------------------------------------------------------------------- 1 | 7eer.net 2 | ad.doubleclick.net 3 | affiliatefuture.com 4 | anrdoezrs.net 5 | apmebf.com 6 | avantlink.com 7 | bfast.com 8 | cc-dt.com 9 | cj.com 10 | cj.dotomi.com 11 | clickserve.cc-dt.com 12 | commission-junction.com 13 | doubleclick.net 14 | dpbolvw.net 15 | emjcd.com 16 | evyy.net 17 | gan.doubleclick.net 18 | go.redirectingat.com 19 | go2jump.org 20 | gopjn.com 21 | jdoqocy.com 22 | kqzyfj.com 23 | linksynergy.com 24 | ojrq.net 25 | onenetworkdirect.net 26 | partners.webmasterplan.com 27 | pjatr.com 28 | pjtra.com 29 | pntra.com 30 | pntrac.com 31 | pntrack.com 32 | qksrv.net 33 | redirect.at 34 | redirect.viglink.com 35 | redirectingat.com 36 | shareasale.com 37 | tkqlhce.com 38 | www.7eer.net 39 | www.affiliatefuture.com 40 | www.anrdoezrs.net 41 | www.apmebf.com 42 | www.avantlink.com 43 | www.bfast.com 44 | www.cc-dt.com 45 | www.cj.com 46 | www.doubleclick.net 47 | www.dpbolvw.net 48 | www.emjcd.com 49 | www.evyy.net 50 | www.gopjn.com 51 | www.jdoqocy.com 52 | www.kqzyfj.com 53 | www.linksynergy.com 54 | www.ojrq.net 55 | www.onenetworkdirect.net 56 | www.pjatr.com 57 | www.pjtra.com 58 | www.pntra.com 59 | www.pntrac.com 60 | www.pntrack.com 61 | www.qksrv.net 62 | www.tkqlhce.com 63 | tradetracker.net 64 | www.tradetracker.net 65 | click.linksynergy.com 66 | clk.tradedoubler.com 67 | tc.tradetracker.com 68 | track.adform.net 69 | track.webgains.com 70 | ad.atdmt.com 71 | clickserve.dartsearch.net 72 | 5231.xg4ken.com 73 | shareasale-analytics.com 74 | www.kqzyfj.com 75 | go.skimresources.com 76 | goto-target-com.customtraffic.impactradius.com 77 | goto.target.com 78 | -------------------------------------------------------------------------------- /domains/whitelist.txt: -------------------------------------------------------------------------------- 1 | 0.client-channel.google.com 2 | 1drv.com 3 | 2.android.pool.ntp.org 4 | akamaihd.net 5 | akamaitechnologies.com 6 | akamaized.net 7 | amazonaws.com 8 | android.clients.google.com 9 | api.ipify.org 10 | api.rlje.net 11 | app-api.ted.com 12 | appleid.apple.com 13 | apps.skype.com 14 | appsbackup-pa.clients6.google.com 15 | appsbackup-pa.googleapis.com 16 | apt.sonarr.tv 17 | aspnetcdn.com 18 | attestation.xboxlive.com 19 | ax.phobos.apple.com.edgesuite.net 20 | brightcove.net 21 | c.s-microsoft.com 22 | cdn.cloudflare.net 23 | cdn.embedly.com 24 | cdn.optimizely.com 25 | cdn.vidible.tv 26 | cdn2.optimizely.com 27 | cdn3.optimizely.com 28 | cdnjs.cloudflare.com 29 | cert.mgt.xboxlive.com 30 | clientconfig.passport.net 31 | clients1.google.com 32 | clients2.google.com 33 | clients3.google.com 34 | clients4.google.com 35 | clients5.google.com 36 | clients6.google.com 37 | cpms.spop10.ams.plex.bz 38 | cpms35.spop10.ams.plex.bz 39 | cse.google.com 40 | ctldl.windowsupdate.com 41 | d2c8v52ll5s99u.cloudfront.net 42 | d2gatte9o95jao.cloudfront.net 43 | dashboard.plex.tv 44 | dataplicity.com 45 | def-vef.xboxlive.com 46 | delivery.vidible.tv 47 | dev.virtualearth.net 48 | device.auth.xboxlive.com 49 | display.ugc.bazaarvoice.com 50 | displaycatalog.mp.microsoft.com 51 | dl.delivery.mp.microsoft.com 52 | dl.dropbox.com 53 | dl.dropboxusercontent.com 54 | dns.msftncsi.com 55 | download.sonarr.tv 56 | drift.com 57 | driftt.com 58 | dynupdate.no-ip.com 59 | ecn.dev.virtualearth.net 60 | edge.api.brightcove.com 61 | eds.xboxlive.com 62 | fonts.gstatic.com 63 | forums.sonarr.tv 64 | g.live.com 65 | geo-prod.do.dsp.mp.microsoft.com 66 | geo3.ggpht.com 67 | giphy.com 68 | github.com 69 | github.io 70 | googleapis.com 71 | gravatar.com 72 | gstatic.com 73 | help.ui.xboxlive.com 74 | hls.ted.com 75 | i.ytimg.com 76 | i1.ytimg.com 77 | imagesak.secureserver.net 78 | img.vidible.tv 79 | imgix.net 80 | imgs.xkcd.com 81 | instantmessaging-pa.googleapis.com 82 | intercom.io 83 | jquery.com 84 | jsdelivr.net 85 | keystone.mwbsys.com 86 | lastfm-img2.akamaized.net 87 | licensing.xboxlive.com 88 | live.com 89 | login.live.com 90 | login.microsoftonline.com 91 | manifest.googlevideo.com 92 | meta-db-worker02.pop.ric.plex.bz 93 | meta.plex.bz 94 | meta.plex.tv 95 | microsoftonline.com 96 | msftncsi.com 97 | my.plexapp.com 98 | nexusrules.officeapps.live.com 99 | npr-news.streaming.adswizz.com 100 | nine.plugins.plexapp.com 101 | no-ip.com 102 | node.plexapp.com 103 | notify.xboxlive.com 104 | ns1.dropbox.com 105 | ns2.dropbox.com 106 | o1.email.plex.tv 107 | o2.sg0.plex.tv 108 | ocsp.apple.com 109 | office.com 110 | office.net 111 | office365.com 112 | officeclient.microsoft.com 113 | om.cbsi.com 114 | onedrive.live.com 115 | outlook.live.com 116 | outlook.office365.com 117 | placehold.it 118 | placeholdit.imgix.net 119 | players.brightcove.net 120 | pricelist.skype.com 121 | products.office.com 122 | proxy.plex.bz 123 | proxy.plex.tv 124 | proxy02.pop.ord.plex.bz 125 | pubsub.plex.bz 126 | pubsub.plex.tv 127 | raw.githubusercontent.com 128 | redirector.googlevideo.com 129 | res.cloudinary.com 130 | s.gateway.messenger.live.com 131 | s.marketwatch.com 132 | s.youtube.com 133 | s.ytimg.com 134 | s1.wp.com 135 | s2.youtube.com 136 | s3.amazonaws.com 137 | sa.symcb.com 138 | secure.avangate.com 139 | secure.brightcove.com 140 | secure.surveymonkey.com 141 | services.sonarr.tv 142 | skyhook.sonarr.tv 143 | spclient.wg.spotify.com 144 | ssl.p.jwpcdn.com 145 | staging.plex.tv 146 | status.plex.tv 147 | t.co 148 | t0.ssl.ak.dynamic.tiles.virtualearth.net 149 | t0.ssl.ak.tiles.virtualearth.net 150 | tawk.to 151 | tedcdn.com 152 | themoviedb.com 153 | thetvdb.com 154 | tinyurl.com 155 | title.auth.xboxlive.com 156 | title.mgt.xboxlive.com 157 | traffic.libsyn.com 158 | tvdb2.plex.tv 159 | tvthemes.plexapp.com 160 | twimg.com 161 | ui.skype.com 162 | video-stats.l.google.com 163 | videos.vidible.tv 164 | widget-cdn.rpxnow.com 165 | win10.ipv6.microsoft.com 166 | wp.com 167 | ws.audioscrobbler.com 168 | www.dataplicity.com 169 | www.googleapis.com 170 | www.msftncsi.com 171 | www.no-ip.com 172 | www.youtube-nocookie.com 173 | xbox.ipv6.microsoft.com 174 | xboxexperiencesprod.experimentation.xboxlive.com 175 | xflight.xboxlive.com 176 | xkms.xboxlive.com 177 | xsts.auth.xboxlive.com 178 | youtu.be 179 | youtube-nocookie.com 180 | yt3.ggpht.com 181 | zee.cws.conviva.com 182 | pings.conviva.com 183 | cws.conviva.com 184 | livepassdl.conviva.com 185 | gfwsl.geforce.com 186 | appspot-preview.l.google.com 187 | vidtech.cbsinteractive.com 188 | continuum.dds.microsoft.com 189 | connectivitycheck.gstatic.com 190 | connectivitycheck.android.com 191 | www.msftconnecttest.com 192 | -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anudeepND/whitelist/30c75868f56a4d46b3cf164e184cd888ee254fe2/images/logo.png -------------------------------------------------------------------------------- /images/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anudeepND/whitelist/30c75868f56a4d46b3cf164e184cd888ee254fe2/images/paypal.png -------------------------------------------------------------------------------- /images/uninstall.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anudeepND/whitelist/30c75868f56a4d46b3cf164e184cd888ee254fe2/images/uninstall.gif -------------------------------------------------------------------------------- /images/upi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anudeepND/whitelist/30c75868f56a4d46b3cf164e184cd888ee254fe2/images/upi.png -------------------------------------------------------------------------------- /images/whitelist.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/anudeepND/whitelist/30c75868f56a4d46b3cf164e184cd888ee254fe2/images/whitelist.gif -------------------------------------------------------------------------------- /scripts/domains.sql: -------------------------------------------------------------------------------- 1 | (0, '0.client-channel.google.com', 1, 'In order for users on your network to access Google Drive and Google Docs editors this domain must be whitelisted - https://support.google.com/a/answer/2589954?hl=en - qjz9zk') 2 | (0, '1drv.com', 1, 'It is actually a legitimate Microsoft owned domain and used as a short link for OneDrive documents. - qjz9zk') 3 | (0, '2.android.pool.ntp.org', 1, 'This domain is a part of The pool.ntp.org project which is a big virtual cluster of timeservers providing reliable time. This domain is used in Android devices - qjz9zk') 4 | (0, 'akamaihd.net', 1, 'This domain is owned by Akamai Technologies which is a is a global content delivery network (CDN). - qjz9zk') 5 | (0, 'akamaitechnologies.com', 1, 'This domain is owned by Akamai Technologies which is a is a global content delivery network (CDN). - qjz9zk') 6 | (0, 'akamaized.net', 1, 'This domain is owned by Akamai Technologies which is a is a global content delivery network (CDN). - qjz9zk') 7 | (0, 'amazonaws.com', 1, 'Amazon Web Services (AWS) is a subsidiary of Amazon providing on-demand cloud computing platforms and APIs. This domain is used to serve files and other static resources which are hosted on Amazon AWS - qjz9zk') 8 | (0, 'android.clients.google.com', 1, 'Google Play Store and few devices (especially Android One devices) depends on this domain for system updates. - qjz9zk') 9 | (0, 'api.ipify.org', 1, 'It is used to get your public IP address programmatically. ipify is completely opensource. - qjz9zk') 10 | (0, 'app-api.ted.com', 1, 'Used by ted.com streams. - qjz9zk') 11 | (0, 'api.rlje.net', 1, 'Used to deliver contents on video straming apps on hulu etc. - qjz9zk') 12 | (0, 'appleid.apple.com', 1, 'Used to sign in t your Apple account. - qjz9zk') 13 | (0, 'apps.skype.com', 1, 'Used to make group calls, group chats etc. on Skype. - qjz9zk') 14 | (0, 'appsbackup-pa.clients6.google.com', 1, 'Used to backup device settings and app data. - qjz9zk') 15 | (0, 'appsbackup-pa.googleapis.com', 1, 'Used to backup device settings and app data. - qjz9zk') 16 | (0, 'apt.sonarr.tv', 1, 'Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. - qjz9zk') 17 | (0, 'aspnetcdn.com', 1, 'Owned by Microsoft. Used to deliver files such as Windows updates and other services. - qjz9zk') 18 | (0, 'attestation.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 19 | (0, 'ax.phobos.apple.com.edgesuite.net', 1, 'Used by Apple Photos. - qjz9zk') 20 | (0, 'brightcove.net', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 21 | (0, 'c.s-microsoft.com', 1, 'Used to deliver fonts. - qjz9zk') 22 | (0, 'cdn.cloudflare.net', 1, 'Used to deliver static files over CloudFlare CDN. - qjz9zk') 23 | (0, 'cdn.embedly.com', 1, 'Embedly is used to embed videos, images and rich media from 300+ providers with just the URL. - qjz9zk') 24 | (0, 'cdn.optimizely.com', 1, 'optimizely.com is a progressive delivery and experimentation software for other companies. Often used as a video delivery system. - qjz9zk') 25 | (0, 'cdn.vidible.tv', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 26 | (0, 'cdn2.optimizely.com', 1, 'optimizely.com is a progressive delivery and experimentation software for other companies. Often used as a video delivery system. - qjz9zk') 27 | (0, 'cdn3.optimizely.com', 1, 'optimizely.com is a progressive delivery and experimentation software for other companies. Often used as a video delivery system. - qjz9zk') 28 | (0, 'cdnjs.cloudflare.com', 1, 'Used to deliver static files over CloudFlare CDN. - qjz9zk') 29 | (0, 'cert.mgt.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 30 | (0, 'clientconfig.passport.net', 1, 'Owned by Microsoft. Used in Windows Store. - qjz9zk') 31 | (0, 'clients1.google.com', 1, 'Used in Google Maps and other Google services. - qjz9zk') 32 | (0, 'clients2.google.com', 1, 'Used in Google Maps and other Google services. - qjz9zk') 33 | (0, 'clients3.google.com', 1, 'Used in Google Maps and other Google services. - qjz9zk') 34 | (0, 'clients4.google.com', 1, 'Used in Google Maps and other Google services. - qjz9zk') 35 | (0, 'clients5.google.com', 1, 'Used in Google Maps and other Google services. - qjz9zk') 36 | (0, 'clients6.google.com', 1, 'Used in Google Maps and other Google services. - qjz9zk') 37 | (0, 'cpms.spop10.ams.plex.bz', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 38 | (0, 'cpms35.spop10.ams.plex.bz', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 39 | (0, 'cse.google.com', 1, 'Google Custom Search. Often used as a search functionality inside a website. https://programmablesearchengine.google.com/about/ - qjz9zk') 40 | (0, 'ctldl.windowsupdate.com', 1, 'Owned by Microsoft. Used to deliver Windows updates. - qjz9zk') 41 | (0, 'cws.conviva.com', 1, 'Conviva offers online video optimization and online video analytics. But it is neccessary to whitelist in order to watch many online contents which uses Conviva. - qjz9zk') 42 | (0, 'livepassdl.conviva.com', 1, 'Conviva offers online video optimization and online video analytics. But it is neccessary to whitelist in order to watch many online contents which uses Conviva. - qjz9zk') 43 | (0, 'zee.cws.conviva.com', 1, 'Conviva offers online video optimization and online video analytics. But it is neccessary to whitelist in order to watch many online contents which uses Conviva. - qjz9zk') 44 | (0, 'pings.conviva.com', 1, 'Conviva offers online video optimization and online video analytics. But it is neccessary to whitelist in order to watch many online contents which uses Conviva. - qjz9zk') 45 | (0, 'gfwsl.geforce.com', 1, 'Used for checking nVidia driver updates. - qjz9zk') 46 | (0, 'appspot-preview.l.google.com', 1, 'Used to deliver system updates to Moto phones. - qjz9zk') 47 | (0, 'd2c8v52ll5s99u.cloudfront.net', 1, 'Domain owned by Amazon. Used to deliver media such as videos in entertainment and news sites. - qjz9zk') 48 | (0, 'd2gatte9o95jao.cloudfront.net', 1, 'Domain owned by Amazon. Used to deliver media such as videos in entertainment and news sites. - qjz9zk') 49 | (0, 'dashboard.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 50 | (0, 'dataplicity.com', 1, 'Used to remotely control your Raspberry-Pi. - qjz9zk') 51 | (0, 'def-vef.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 52 | (0, 'delivery.vidible.tv', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 53 | (0, 'dev.virtualearth.net', 1, 'Owned by Microsoft. Used by Bing Maps to get information about various places. For example, this domain should be whitelisted in order to select a store location on costco.com. - qjz9zk') 54 | (0, 'device.auth.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 55 | (0, 'display.ugc.bazaarvoice.com', 1, 'To display Ratings & Reviews or Questions & Answers in online stores. - qjz9zk') 56 | (0, 'displaycatalog.mp.microsoft.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 57 | (0, 'dl.delivery.mp.microsoft.com', 1, 'Used to deliver updates to Microsoft products. - qjz9zk') 58 | (0, 'dl.dropbox.com', 1, 'Used to download files from Dropbox - qjz9zk') 59 | (0, 'dl.dropboxusercontent.com', 1, 'Used to download files from Dropbox - qjz9zk') 60 | (0, 'dns.msftncsi.com', 1, 'Owned by Microsoft. Used to check whether the internet connection is up or not in Windows systems. - qjz9zk') 61 | (0, 'download.sonarr.tv', 1, 'Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. - qjz9zk') 62 | (0, 'drift.com', 1, 'Live chat platform for websites to chat with the website owner. Blocking this domain will block chat widget. - qjz9zk') 63 | (0, 'driftt.com', 1, 'Live chat platform for websites to chat with the website owner. Blocking this domain will block chat widget. - qjz9zk') 64 | (0, 'dynupdate.no-ip.com', 1, 'No-IP offers DNS services, email, network monitoring and SSL certificates - qjz9zk') 65 | (0, 'ecn.dev.virtualearth.net', 1, 'Owned by Microsoft. Used by Bing Maps to get information about various places. For example, this domain should be whitelisted in order to select a store location on costco.com. - qjz9zk') 66 | (0, 'edge.api.brightcove.com', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 67 | (0, 'eds.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 68 | (0, 'fonts.gstatic.com', 1, 'Owned by Google. Used to deliver Google Fonts. - qjz9zk') 69 | (0, 'forums.sonarr.tv', 1, 'Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. - qjz9zk') 70 | (0, 'g.live.com', 1, 'Used by Microsoft for their Outlook.com and OneDrive products. Backup bitlocker recovery key to Microsoft account. - qjz9zk') 71 | (0, 'geo-prod.do.dsp.mp.microsoft.com', 1, 'Enables connections to Windows Update. - qjz9zk') 72 | (0, 'geo3.ggpht.com', 1, 'Owned by Google. Used to deliver static files over the internet. - qjz9zk') 73 | (0, 'giphy.com', 1, 'Gifs hosting platform. - qjz9zk') 74 | (0, 'github.com', 1, 'GitHub provides hosting for software development and version control using Git. - qjz9zk') 75 | (0, 'github.io', 1, 'Owned by GitHub. Used for GitHub pages. - qjz9zk') 76 | (0, 'googleapis.com', 1, 'An important domain used to provide APIs to various Google services. - qjz9zk') 77 | (0, 'gravatar.com', 1, 'Owned by Automattic. Gravatar is a service for providing globally unique avatars - qjz9zk') 78 | (0, 'gstatic.com', 1, 'Owned by Google. gstatic.com is a cookieless domain to deliver static content for Google. - qjz9zk') 79 | (0, 'help.ui.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 80 | (0, 'hls.ted.com', 1, 'Used by ted.com streams. - qjz9zk') 81 | (0, 'i.ytimg.com', 1, 'Owned by Google. Used to deliver thumbails in YouTube. - qjz9zk') 82 | (0, 'i1.ytimg.com', 1, 'Owned by Google. Used to deliver thumbails in YouTube. - qjz9zk') 83 | (0, 'imagesak.secureserver.net', 1, 'GoDaddy webmail buttons - qjz9zk') 84 | (0, 'img.vidible.tv', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 85 | (0, 'imgix.net', 1, 'Image placeholders often used during web page loading. - qjz9zk') 86 | (0, 'imgs.xkcd.com', 1, 'Used to deliver images on xkcd.com. - qjz9zk') 87 | (0, 'instantmessaging-pa.googleapis.com', 1, 'An important domain used to provide APIs to various Google services. - qjz9zk') 88 | (0, 'intercom.io', 1, 'Live chat platform for websites to chat with the website owner. Blocking this domain will block chat widget. - qjz9zk') 89 | (0, 'jquery.com', 1, 'jQuery is a JavaScript library. Also used to deliver the files over CDN. - qjz9zk') 90 | (0, 'jsdelivr.net', 1, ' jsDelivr is a free public CDN for open-source projects. It can serve web files directly from the npm registry and GitHub repositories without any configuration. - qjz9zk') 91 | (0, 'keystone.mwbsys.com', 1, 'Owned by Malwarebytes. It is a licensing system used to verify the Malwarebytes software license. - qjz9zk') 92 | (0, 'lastfm-img2.akamaized.net', 1, 'Used by last.fm to deliver images. - qjz9zk') 93 | (0, 'licensing.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 94 | (0, 'live.com', 1, 'Owned by Microsoft. It is a personal information manager web app from Microsoft consisting of webmail, calendaring, contacts, and tasks services. - qjz9zk') 95 | (0, 'login.live.com', 1, 'Owned by Microsoft. The following endpoint is used to authenticate a device. - qjz9zk') 96 | (0, 'login.microsoftonline.com', 1, 'Owned by Microsoft. Used by Microsoft Office apps. - qjz9zk') 97 | (0, 'manifest.googlevideo.com', 1, 'Used for YouTube live streams. - qjz9zk') 98 | (0, 'meta-db-worker02.pop.ric.plex.bz', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 99 | (0, 'meta.plex.bz', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 100 | (0, 'meta.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 101 | (0, 'microsoftonline.com', 1, 'Owned by Microsoft. This domain is checked by the operating systems when connecting via wifi, and if they do not get the response they expect, they may try to open a wifi login page or similar as they believe they are located behind a captive portal. - qjz9zk') 102 | (0, 'msftncsi.com', 1, 'Owned by Microsoft. This domain is checked by the operating systems when connecting via wifi, and if they do not get the response they expect, they may try to open a wifi login page or similar as they believe they are located behind a captive portal. - qjz9zk') 103 | (0, 'my.plexapp.com', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 104 | (0, 'nexusrules.officeapps.live.com', 1, 'Owned by Microsoft. Used by Microsoft Office apps. - qjz9zk') 105 | (0, 'npr-news.streaming.adswizz.com', 1, 'Used for NPR morning news and podcasts. - qjz9zk') 106 | (0, 'nine.plugins.plexapp.com', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 107 | (0, 'no-ip.com', 1, 'No-IP offers DNS services, email, network monitoring and SSL certificates. - qjz9zk') 108 | (0, 'node.plexapp.com', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 109 | (0, 'notify.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 110 | (0, 'ns1.dropbox.com', 1, 'Dropbox nameserver. Used to download files from Dropbox - qjz9zk') 111 | (0, 'ns2.dropbox.com', 1, 'Dropbox nameserver. Used to download files from Dropbox - qjz9zk') 112 | (0, 'o1.email.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 113 | (0, 'o2.sg0.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 114 | (0, 'ocsp.apple.com', 1, 'iOS developers are able to distribute apps outside of the App Store using an Enterprise provisioning profile. Apple can revoke these kinds of apps by using this domain. - qjz9zk') 115 | (0, 'office.com', 1, 'Owned by Microsoft. Used by Microsoft Office apps. - qjz9zk') 116 | (0, 'office.net', 1, 'Owned by Microsoft. Used by Microsoft Office apps. - qjz9zk') 117 | (0, 'office365.com', 1, 'Owned by Microsoft. Used by Microsoft Office apps. - qjz9zk') 118 | (0, 'officeclient.microsoft.com', 1, 'Used by Microsoft Office apps. - qjz9zk') 119 | (0, 'om.cbsi.com', 1, 'CBS All Access on straming platforms. - qjz9zk') 120 | (0, 'onedrive.live.com', 1, 'Owned by Microsoft. Used to sign in to One Drive. - qjz9zk') 121 | (0, 'outlook.live.com', 1, 'Owned by Microsoft. Used for Outlook email. - qjz9zk') 122 | (0, 'outlook.office365.com', 1, 'Owned by Microsoft. Used for Outlook email.ent - qjz9zk') 123 | (0, 'placehold.it', 1, 'Placehold.it, Image placeholders often used during web page loading. - qjz9zk') 124 | (0, 'placeholdit.imgix.net', 1, 'Placehold.it, Image placeholders often used during web page loading. - qjz9zk') 125 | (0, 'players.brightcove.net', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 126 | (0, 'pricelist.skype.com', 1, 'Used to make group calls, group chats etc. on Skype. - qjz9zk') 127 | (0, 'products.office.com', 1, 'Owned by Microsoft. Used by Microsoft Office apps. - qjz9zk') 128 | (0, 'proxy.plex.bz', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 129 | (0, 'proxy.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 130 | (0, 'proxy02.pop.ord.plex.bz', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 131 | (0, 'pubsub.plex.bz', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 132 | (0, 'pubsub.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 133 | (0, 'raw.githubusercontent.com', 1, 'Owned by GitHub. It is used to serve unprocessed versions of files stored in GitHub repositories. - qjz9zk') 134 | (0, 'redirector.googlevideo.com', 1, 'Used by YouTube to play embedded videos on third-party websites. - qjz9zk') 135 | (0, 'res.cloudinary.com', 1, 'Cloudinary provides a cloud-based image and video management services. It enables users to upload, store, manage, manipulate, and deliver images and video for websites and apps. - qjz9zk') 136 | (0, 's.gateway.messenger.live.com', 1, 'Owned by Microsoft. It is a personal information manager web app from Microsoft consisting of webmail, calendaring, contacts, and tasks services. - qjz9zk') 137 | (0, 's.marketwatch.com', 1, 'Images are loaded on marketwatch.com using this domain. - qjz9zk') 138 | (0, 's.youtube.com', 1, 'Used to record YouTube watch history. Blocking this domain will pause your watch history on YouTube. - qjz9zk') 139 | (0, 's.ytimg.com', 1, 'Owned by Google. Used to deliver thumbails in YouTube. - qjz9zk') 140 | (0, 's1.wp.com', 1, 'Owned by WordPress. Used to feliver static files and media for websites which are hosted on wordpress.com platform. - qjz9zk') 141 | (0, 's2.youtube.com', 1, 'Used to record YouTube watch history. Blocking this domain will pause your watch history on YouTube. - qjz9zk') 142 | (0, 's3.amazonaws.com', 1, 'Used to deliver files that are stored in Amazon AWS S3 storage buckets. - qjz9zk') 143 | (0, 'sa.symcb.com', 1, 'Owned by Symantec. These are Symantec Certificate Revocation List servers and are used by a number of companies including Microsoft. - qjz9zk') 144 | (0, 'secure.avangate.com', 1, 'Used to perform online payments. - qjz9zk') 145 | (0, 'secure.brightcove.com', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 146 | (0, 'secure.surveymonkey.com', 1, 'Used by Survey Monkey to deliver surveys. - qjz9zk') 147 | (0, 'services.sonarr.tv', 1, 'Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. - qjz9zk') 148 | (0, 'skyhook.sonarr.tv', 1, 'Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. - qjz9zk') 149 | (0, 'spclient.wg.spotify.com', 1, 'Spotify on Web and desktop player does not work if this domain is blocked. - qjz9zk') 150 | (0, 'ssl.p.jwpcdn.com', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 151 | (0, 'staging.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 152 | (0, 'status.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 153 | (0, 't.co', 1, 'Owned by Twitter. Used as a URL shortner while sharing Twitter posts. - qjz9zk') 154 | (0, 't0.ssl.ak.dynamic.tiles.virtualearth.net', 1, 'Owned by Microsoft. Used by Bing Maps to get information about various places. For example, this domain should be whitelisted in order to select a store location on costco.com. - qjz9zk') 155 | (0, 't0.ssl.ak.tiles.virtualearth.net', 1, 'Owned by Microsoft. Used by Bing Maps to get information about various places. For example, this domain should be whitelisted in order to select a store location on costco.com. - qjz9zk') 156 | (0, 'tawk.to', 1, 'Live chat platform for websites to chat with the website owner. Blocking this domain will block chat widget. - qjz9zk') 157 | (0, 'tedcdn.com', 1, 'Used by ted.com streams. - qjz9zk') 158 | (0, 'themoviedb.com', 1, 'Metadata for movies - qjz9zk') 159 | (0, 'thetvdb.com', 1, 'Metadata for TV series - qjz9zk') 160 | (0, 'tinyurl.com', 1, 'Popular URL shortner - qjz9zk') 161 | (0, 'title.auth.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 162 | (0, 'title.mgt.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 163 | (0, 'traffic.libsyn.com', 1, 'Used in Pocketcasts app to serve and download podcasts. - qjz9zk') 164 | (0, 'tvdb2.plex.tv', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 165 | (0, 'tvthemes.plexapp.com', 1, 'Plex is a client–server media player system plus an ancillary software suite. - qjz9zk') 166 | (0, 'twimg.com', 1, 'Owned by Twitter. Used to deliver media on Twitter. - qjz9zk') 167 | (0, 'ui.skype.com', 1, 'Used to make group calls, group chats etc. on Skype. - qjz9zk') 168 | (0, 'video-stats.l.google.com', 1, 'Used to record YouTube watch history. Blocking this domain will pause your watch history on YouTube. - qjz9zk') 169 | (0, 'videos.vidible.tv', 1, 'Video delivery systems, popular in entertainment and news sites. - qjz9zk') 170 | (0, 'widget-cdn.rpxnow.com', 1, 'Owned by Akamai Technologies. Used as a sign in method in various apps and sites. - qjz9zk') 171 | (0, 'win10.ipv6.microsoft.com', 1, 'It gives full IPv6 connectivity for IPv6-capable hosts that are on the IPv4 Internet but have no native connection to an IPv6 network. - qjz9zk') 172 | (0, 'wp.com', 1, 'Owned by WordPress.com hosting. - qjz9zk') 173 | (0, 'ws.audioscrobbler.com', 1, 'Owned by last.fm. Used to get track metadata using last.fm API. - qjz9zk') 174 | (0, 'www.dataplicity.com', 1, 'Used to remotely control your Raspberry-Pi. - qjz9zk') 175 | (0, 'www.googleapis.com', 1, 'An important domain used to provide APIs to various Google services. - qjz9zk') 176 | (0, 'www.msftncsi.com', 1, 'Owned by Microsoft. This domain is checked by the operating systems when connecting via wifi, and if they do not get the response they expect, they may try to open a wifi login page or similar as they believe they are located behind a captive portal. - qjz9zk') 177 | (0, 'www.no-ip.com', 1, 'No-IP offers DNS services, email, network monitoring and SSL certificates. - qjz9zk') 178 | (0, 'www.youtube-nocookie.com', 1, 'Owned by Google. YouTube launched a new feature on the site recently that it called Privacy-Enhanced Mode. This domain is used to embed the videos on third-party sites with less trackers. - qjz9zk') 179 | (0, 'xbox.ipv6.microsoft.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 180 | (0, 'xboxexperiencesprod.experimentation.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 181 | (0, 'xflight.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 182 | (0, 'xkms.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 183 | (0, 'xsts.auth.xboxlive.com', 1, 'Owned by Microsoft. Used for Xbox updates, game downloads, acheivements unlocking etc. - qjz9zk') 184 | (0, 'youtube-nocookie.com', 1, 'Owned by Google. YouTube launched a new feature on the site recently that it called Privacy-Enhanced Mode. This domain is used to embed the videos on third-party sites with less trackers. - qjz9zk') 185 | (0, 'youtu.be', 1, 'YouTube URL shortner. Used while sharing videos, playlists, channels etc. - qjz9zk') 186 | (0, 'yt3.ggpht.com', 1, 'Owned by Google. Used to deliver static files over the internet. - qjz9zk') 187 | (0, 'vidtech.cbsinteractive.com', 1, 'Used to deliver videos over the internet. - qjz9zk') 188 | (0, 'continuum.dds.microsoft.com', 1, 'Used by YourPhone app by Microsoft on Windows 10 for mirroring Android notifications - qjz9zk') 189 | (0, 'connectivitycheck.gstatic.com', 1, 'Owned by Google. Used by mobiles devices to check internet connectivity. Also known as Network Connectivity Status Indicator-NCSI. - qjz9zk') 190 | (0, 'connectivitycheck.android.com', 1, 'Owned by Google. Used by mobiles devices to check internet connectivity. Also known as Network Connectivity Status Indicator-NCSI. - qjz9zk') 191 | (0, 'www.msftconnecttest.com', 1, 'Owned by Microsoft. Used by Windows systems to check internet connectivity. Also known as Network Connectivity Status Indicator-NCSI. - qjz9zk') 192 | -------------------------------------------------------------------------------- /scripts/referral.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script will download and add domains from the rep to whitelist.txt file. 3 | # Project homepage: https://github.com/anudeepND/whitelist 4 | # Licence: https://github.com/anudeepND/whitelist/blob/master/LICENSE 5 | # Created by Anudeep 6 | #================================================================================ 7 | TICK="[\e[32m ✔ \e[0m]" 8 | PIHOLE_LOCATION="/etc/pihole" 9 | GRAVITY_UPDATE_COMMAND="pihole -w -q" 10 | 11 | while [[ "$#" -gt 0 ]]; do 12 | case $1 in 13 | -d|--dir) PIHOLE_LOCATION="$2"; shift ;; 14 | -D|--docker) GRAVITY_UPDATE_COMMAND="docker exec pihole pihole -w -q" ;; 15 | *) echo "Unknown parameter passed: $1"; exit 1 ;; 16 | esac 17 | shift 18 | done 19 | 20 | echo -e " \e[1m This file contains tracking and adserving domains. Run this script if you use specific service (like Slickdeals and Fatwallet etc.) that require certain adserving domains to be whitelisted. If you don't know what these services are, stay away from this list. \e[0m" 21 | read -p "Do you want to continue (Y/N)? " -n 1 -r 22 | echo 23 | if [[ $REPLY =~ ^[Yy]$ ]] 24 | then 25 | 26 | echo -e " \e[1m This script will download and add domains from the repo to whitelist.txt \e[0m" 27 | sleep 1 28 | echo -e "\n" 29 | 30 | if [ "$(id -u)" != "0" ] ; then 31 | echo "This script requires root permissions. Please run this as root!" 32 | exit 2 33 | fi 34 | 35 | 36 | curl -sS https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/referral-sites.txt | sudo tee -a "${PIHOLE_LOCATION}"/whitelist.txt >/dev/null 37 | echo -e " ${TICK} \e[32m Adding domains to whitelist... \e[0m" 38 | sleep 0.5 39 | echo -e " ${TICK} \e[32m Removing duplicates... \e[0m" 40 | 41 | mv "${PIHOLE_LOCATION}"/whitelist.txt "${PIHOLE_LOCATION}"/whitelist.txt.old && cat "${PIHOLE_LOCATION}"/whitelist.txt.old | sort | uniq >> "${PIHOLE_LOCATION}"/whitelist.txt 42 | 43 | wait 44 | echo -e " [...] \e[32m Pi-hole gravity rebuilding lists. This may take a while \e[0m" 45 | ${GRAVITY_UPDATE_COMMAND} $(cat "${PIHOLE_LOCATION}"/whitelist.txt | xargs) > /dev/null 46 | wait 47 | echo -e " ${TICK} \e[32m Pi-hole's gravity updated \e[0m" 48 | echo -e " ${TICK} \e[32m Done! \e[0m" 49 | 50 | 51 | echo -e " \e[1m Buy me a coffee: https://paypal.me/anudeepND \e[0m" 52 | echo -e " \e[1m Star me on GitHub, https://github.com/anudeepND/whitelist \e[0m" 53 | echo -e " \e[1m Happy AdBlocking :)\e[0m" 54 | echo -e "\n\n" 55 | 56 | fi 57 | -------------------------------------------------------------------------------- /scripts/uninstall.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Project homepage: https://github.com/anudeepND/whitelist 4 | # Licence: https://github.com/anudeepND/whitelist/blob/master/LICENSE 5 | # Created by Anudeep 6 | # ================================================================================ 7 | import os 8 | import argparse 9 | import sqlite3 10 | import subprocess 11 | from urllib.request import Request, urlopen 12 | from urllib.error import HTTPError, URLError 13 | 14 | 15 | def fetch_whitelist_url(url): 16 | 17 | if not url: 18 | return 19 | 20 | headers = { 21 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0'} 22 | 23 | try: 24 | response = urlopen(Request(url, headers=headers)) 25 | except HTTPError as e: 26 | print('[X] HTTP Error:', e.code, 'whilst fetching', url) 27 | print('\n') 28 | print('\n') 29 | exit(1) 30 | except URLError as e: 31 | print('[X] URL Error:', e.reason, 'whilst fetching', url) 32 | print('\n') 33 | print('\n') 34 | exit(1) 35 | 36 | # Read and decode 37 | response = response.read().decode('UTF-8').replace('\r\n', '\n') 38 | 39 | # If there is data 40 | if response: 41 | # Strip leading and trailing whitespace 42 | response = '\n'.join(x.strip() for x in response.splitlines()) 43 | 44 | # Return the hosts 45 | return response 46 | 47 | 48 | def dir_path(string): 49 | if os.path.isdir(string): 50 | return string 51 | else: 52 | raise NotADirectoryError(string) 53 | 54 | 55 | def restart_pihole(docker): 56 | if docker is True: 57 | subprocess.call("docker exec -it pihole pihole restartdns reload", 58 | shell=True, stdout=subprocess.DEVNULL) 59 | else: 60 | subprocess.call(['pihole', 'restartdns', 'reload'], 61 | stdout=subprocess.DEVNULL) 62 | 63 | 64 | parser = argparse.ArgumentParser() 65 | parser.add_argument("-d", "--dir", type=dir_path, 66 | help="optional: Pi-hole etc directory") 67 | parser.add_argument( 68 | "-D", "--docker", action='store_true', help="optional: set if you're using Pi-hole in Docker environment") 69 | args = parser.parse_args() 70 | 71 | if args.dir: 72 | pihole_location = args.dir 73 | else: 74 | pihole_location = r'/etc/pihole' 75 | 76 | 77 | whitelist_remote_url = 'https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt' 78 | remote_sql_url = 'https://raw.githubusercontent.com/anudeepND/whitelist/master/scripts/domains.sql' 79 | gravity_whitelist_location = os.path.join(pihole_location, 'whitelist.txt') 80 | gravity_db_location = os.path.join(pihole_location, 'gravity.db') 81 | anudeep_whitelist_location = os.path.join( 82 | pihole_location, 'anudeep-whitelist.txt') 83 | 84 | db_exists = False 85 | sqliteConnection = None 86 | cursor = None 87 | 88 | whitelist_remote = set() 89 | whitelist_local = set() 90 | whitelist_anudeep_local = set() 91 | whitelist_old_anudeep = set() 92 | 93 | os.system('clear') 94 | print('\n') 95 | print(''' 96 | If you are using Pi-hole 5.0 or later, then this script will remove the domains which are only added by my script. 97 | Any other domains added by you will stay as it is. 98 | ''') 99 | print('\n') 100 | 101 | # Check for pihole path exsists 102 | if os.path.exists(pihole_location): 103 | print('[i] Pi-hole path exists') 104 | else: 105 | print("[X] {} was not found".format(pihole_location)) 106 | print('\n') 107 | print('\n') 108 | exit(1) 109 | 110 | # Check for write access to /etc/pihole 111 | if os.access(pihole_location, os.X_OK | os.W_OK): 112 | print("[i] Write access to {} verified" .format(pihole_location)) 113 | whitelist_str = fetch_whitelist_url(whitelist_remote_url) 114 | remote_whitelist_lines = whitelist_str.count('\n') 115 | remote_whitelist_lines += 1 116 | else: 117 | print("[X] Write access is not available for {}. Please run as root or other privileged user" .format( 118 | pihole_location)) 119 | print('\n') 120 | print('\n') 121 | exit(1) 122 | 123 | # Determine whether we are using DB or not 124 | if os.path.isfile(gravity_db_location) and os.path.getsize(gravity_db_location) > 0: 125 | db_exists = True 126 | print('[i] Pi-Hole Gravity database found') 127 | 128 | remote_sql_str = fetch_whitelist_url(remote_sql_url) 129 | remote_sql_lines = remote_sql_str.count('\n') 130 | remote_sql_lines += 1 131 | 132 | if len(remote_sql_str) > 0: 133 | print("[i] {} domains discovered" .format(remote_whitelist_lines)) 134 | else: 135 | print('[X] No remote SQL queries found') 136 | print('\n') 137 | print('\n') 138 | exit(1) 139 | else: 140 | print('[i] Legacy Pi-hole detected (Version older than 5.0)') 141 | 142 | if whitelist_str: 143 | whitelist_remote.update(x for x in map( 144 | str.strip, whitelist_str.splitlines()) if x and x[:1] != '#') 145 | else: 146 | print('[X] No remote domains were found.') 147 | print('\n') 148 | print('\n') 149 | exit(1) 150 | 151 | if db_exists: 152 | # Create a DB connection 153 | print('[i] Connecting to Gravity database') 154 | 155 | try: 156 | sqliteConnection = sqlite3.connect(gravity_db_location) 157 | cursor = sqliteConnection.cursor() 158 | print('[i] Successfully Connected to Gravity database') 159 | total_domains = cursor.execute(" SELECT * FROM domainlist WHERE type = 0 AND comment LIKE '%qjz9zk%' ") 160 | 161 | totalDomains = len(total_domains.fetchall()) 162 | print("[i] There are a total of {} domains in your whitelist which are added by my script" .format(totalDomains)) 163 | print('[i] Removing domains in the Gravity database') 164 | cursor.execute (" DELETE FROM domainlist WHERE type = 0 AND comment LIKE '%qjz9zk%' ") 165 | 166 | sqliteConnection.commit() 167 | 168 | # we only removed domains we added so use total_domains 169 | print("[i] {} domains are removed" .format(totalDomains)) 170 | remaining_domains = cursor.execute(" SELECT * FROM domainlist WHERE type = 0 OR type = 2 ") 171 | print("[i] There are a total of {} domains remaining in your whitelist" .format(len(remaining_domains.fetchall()))) 172 | 173 | cursor.close() 174 | 175 | except sqlite3.Error as error: 176 | print('[X] Failed to remove domains from Gravity database', error) 177 | print('\n') 178 | print('\n') 179 | exit(1) 180 | 181 | finally: 182 | if (sqliteConnection): 183 | sqliteConnection.close() 184 | 185 | print('[i] The database connection is closed') 186 | 187 | print('[i] Restarting Pi-hole. This could take a few seconds') 188 | restart_pihole(args.docker) 189 | print('\n') 190 | print('Done. Happy ad-blocking :)') 191 | print('\n') 192 | print('Star me on GitHub: https://github.com/anudeepND/whitelist') 193 | print('Buy me a coffee: https://paypal.me/anudeepND') 194 | print('\n') 195 | 196 | else: 197 | if os.path.isfile(gravity_whitelist_location) and os.path.getsize(gravity_whitelist_location) > 0: 198 | with open(gravity_whitelist_location, 'r') as fRead: 199 | whitelist_local.update(x for x in map( 200 | str.strip, fRead) if x and x[:1] != '#') 201 | 202 | if whitelist_local: 203 | print("[i] {} existing whitelisted domains identified" .format( 204 | len(whitelist_local))) 205 | 206 | if os.path.isfile(anudeep_whitelist_location) and os.path.getsize(anudeep_whitelist_location) > 0: 207 | print('[i] Existing anudeep-whitelist install identified') 208 | with open(anudeep_whitelist_location, 'r') as fOpen: 209 | whitelist_old_anudeep.update(x for x in map( 210 | str.strip, fOpen) if x and x[:1] != '#') 211 | 212 | if whitelist_old_anudeep: 213 | whitelist_local.difference_update(whitelist_old_anudeep) 214 | 215 | os.remove(anudeep_whitelist_location) 216 | 217 | else: 218 | print('[i] Removing domains that match the remote repo') 219 | whitelist_local.difference_update(whitelist_remote) 220 | 221 | print("[i] Adding exsisting {} domains to {}" .format( 222 | len(whitelist_local), gravity_whitelist_location)) 223 | with open(gravity_whitelist_location, 'w') as fWrite: 224 | for line in sorted(whitelist_local): 225 | fWrite.write("{}\n".format(line)) 226 | 227 | print('[i] Restarting Pi-hole. This could take a few seconds') 228 | restart_pihole(args.docker) 229 | print('[i] Done - Domains are now removed your Pi-Hole whitelist') 230 | print('\n') 231 | print('Happy ad-blocking :)') 232 | print('\n') 233 | print('Star me on GitHub: https://github.com/anudeepND/whitelist') 234 | print('Buy me a coffee: https://paypal.me/anudeepND') 235 | print('\n') 236 | -------------------------------------------------------------------------------- /scripts/whitelist.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # Project homepage: https://github.com/anudeepND/whitelist 4 | # Licence: https://github.com/anudeepND/whitelist/blob/master/LICENSE 5 | # Created by Anudeep 6 | # ================================================================================ 7 | import os 8 | import argparse 9 | import sqlite3 10 | import subprocess 11 | from urllib.request import Request, urlopen 12 | from urllib.error import HTTPError, URLError 13 | import time 14 | 15 | today = int(time.time()) 16 | 17 | def fetch_whitelist_url(url): 18 | 19 | if not url: 20 | return 21 | 22 | headers = { 23 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0'} 24 | 25 | try: 26 | response = urlopen(Request(url, headers=headers)) 27 | except HTTPError as e: 28 | print('[X] HTTP Error:', e.code, 'whilst fetching', url) 29 | print('\n') 30 | print('\n') 31 | exit(1) 32 | except URLError as e: 33 | print('[X] URL Error:', e.reason, 'whilst fetching', url) 34 | print('\n') 35 | print('\n') 36 | exit(1) 37 | 38 | # Read and decode 39 | response = response.read().decode('UTF-8').replace('\r\n', '\n') 40 | 41 | # If there is data 42 | if response: 43 | # Strip leading and trailing whitespace 44 | response = '\n'.join(x.strip() for x in response.splitlines()) 45 | 46 | # Return the hosts 47 | return response 48 | 49 | def dir_path(string): 50 | if os.path.isdir(string): 51 | return string 52 | else: 53 | raise NotADirectoryError(string) 54 | 55 | def restart_pihole(docker): 56 | if docker is True: 57 | subprocess.call("docker exec -it pihole pihole restartdns reload", 58 | shell=True, stdout=subprocess.DEVNULL) 59 | else: 60 | subprocess.call(['pihole', '-g'], stdout=subprocess.DEVNULL) 61 | 62 | parser = argparse.ArgumentParser() 63 | parser.add_argument("-d", "--dir", type=dir_path, help="optional: Pi-hole etc directory") 64 | parser.add_argument("-D", "--docker", action='store_true', help="optional: set if you're using Pi-hole in docker environment") 65 | args = parser.parse_args() 66 | 67 | if args.dir: 68 | pihole_location = args.dir 69 | else: 70 | pihole_location = r'/etc/pihole' 71 | 72 | whitelist_remote_url = 'https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt' 73 | remote_sql_url = 'https://raw.githubusercontent.com/anudeepND/whitelist/master/scripts/domains.sql' 74 | gravity_whitelist_location = os.path.join(pihole_location, 'whitelist.txt') 75 | gravity_db_location = os.path.join(pihole_location, 'gravity.db') 76 | anudeep_whitelist_location = os.path.join(pihole_location, 'anudeep-whitelist.txt') 77 | 78 | db_exists = False 79 | sqliteConnection = None 80 | cursor = None 81 | 82 | whitelist_remote = set() 83 | whitelist_local = set() 84 | whitelist_anudeep_local = set() 85 | whitelist_old_anudeep = set() 86 | 87 | os.system('clear') 88 | print('\n') 89 | print('This script will download and add domains from the repo to whitelist.') 90 | print('All the domains in this list are safe to add and does not contain any tracking or adserving domains.') 91 | print('\n') 92 | 93 | # Check for pihole path exsists 94 | if os.path.exists(pihole_location): 95 | print('[i] Pi-hole path exists') 96 | else: 97 | # print(f'[X] {pihole_location} was not found') 98 | 99 | print("[X] {} was not found".format(pihole_location)) 100 | 101 | print('\n') 102 | print('\n') 103 | exit(1) 104 | 105 | # Check for write access to /etc/pihole 106 | if os.access(pihole_location, os.X_OK | os.W_OK): 107 | print("[i] Write access to {} verified" .format(pihole_location)) 108 | whitelist_str = fetch_whitelist_url(whitelist_remote_url) 109 | remote_whitelist_lines = whitelist_str.count('\n') 110 | remote_whitelist_lines += 1 111 | else: 112 | print("[X] Write access is not available for {}. Please run as root or other privileged user" .format( 113 | pihole_location)) 114 | print('\n') 115 | print('\n') 116 | exit(1) 117 | 118 | # Determine whether we are using DB or not 119 | if os.path.isfile(gravity_db_location) and os.path.getsize(gravity_db_location) > 0: 120 | db_exists = True 121 | print('[i] Pi-Hole Gravity database found') 122 | 123 | remote_sql_str = fetch_whitelist_url(remote_sql_url) 124 | remote_sql_lines = remote_sql_str.count('\n') 125 | remote_sql_lines += 1 126 | 127 | if len(remote_sql_str) > 0: 128 | print("[i] {} domains and {} SQL queries discovered" .format( 129 | remote_whitelist_lines, remote_sql_lines)) 130 | else: 131 | print('[X] No remote SQL queries found') 132 | print('\n') 133 | print('\n') 134 | exit(1) 135 | else: 136 | print('[i] Legacy Pi-hole detected (Version older than 5.0)') 137 | 138 | # If domains were fetched, remove any comments and add to set 139 | if whitelist_str: 140 | whitelist_remote.update(x for x in map( 141 | str.strip, whitelist_str.splitlines()) if x and x[:1] != '#') 142 | else: 143 | print('[X] No remote domains were found.') 144 | print('\n') 145 | print('\n') 146 | exit(1) 147 | 148 | if db_exists: 149 | print('[i] Connecting to Gravity.') 150 | try: # Try to create a DB connection 151 | sqliteConnection = sqlite3.connect(gravity_db_location) 152 | cursor = sqliteConnection.cursor() 153 | print('[i] Successfully Connected to Gravity.') 154 | # 155 | print('[i] Checking Gravity for domains added by script.') 156 | # Check Gravity database for domains added by script 157 | gravityScript_before = cursor.execute(" SELECT * FROM domainlist WHERE type = 0 AND comment LIKE '%qjz9zk%' ") 158 | # fetch all matching entries which will create a tuple for us 159 | gravScriptBeforeTUP = gravityScript_before.fetchall() 160 | # Number of domains in database from script 161 | gravScriptBeforeTUPlen = len(gravScriptBeforeTUP) 162 | print ("[i] {} Domains from script in whitelist already." .format(gravScriptBeforeTUPlen)) 163 | # 164 | # make `remote_sql_str` a tuple so we can easily compare 165 | newWhiteTUP = remote_sql_str.split('\n') 166 | # Number of domains that would be added by script 167 | newWhiteListlen = len(newWhiteTUP) 168 | # 169 | # get domains from newWhiteTUP and make an ordered list (a list we can use predictably) 170 | nW = [None] * newWhiteListlen 171 | nwl = 0 # keep a count 172 | newWL = [None] 173 | newWhiteList = [None] * newWhiteListlen 174 | for newWhiteDomain in newWhiteTUP: # for each line found domains.sql 175 | nW[nwl] = newWhiteDomain # Add line to a controlled list 176 | removeBrace = nW[nwl].replace('(', '') # remove ( 177 | removeBraces10 = removeBrace.replace(')', '') # remove ) 178 | newWL = removeBraces10.split(', ') # split at commas to create a list 179 | newWhiteList[nwl] = newWL[1].replace('\'', '') # remove ' from domain and add to list 180 | # uncomment to see list of sql varables being imported 181 | # print (nW[nwl]) 182 | # uncomment to see list of domains being imported 183 | # print(newWhiteList[nwl]) 184 | nwl += 1 # count + 1 185 | # check database for user added exact whitelisted domains 186 | print('[i] Checking Gravity for domains added by user that are also in script.') 187 | # Check Gravity database for exact whitelisted domains added by user 188 | user_add = cursor.execute(" SELECT * FROM domainlist WHERE type = 0 AND comment NOT LIKE '%qjz9zk%' ") 189 | userAddTUP = user_add.fetchall() 190 | userAddTUPlen = len(userAddTUP) 191 | # 192 | # 193 | # check if whitelisted domains added by user are in script 194 | userAddList = [None] * userAddTUPlen # create a list that has the same size as the tuple is it compared to 195 | uA = 0 # used to count User Added domains in our script 196 | uagl = False 197 | for userAddINgravity in userAddTUP: # for every whitelisted domain we found in the database do: 198 | if userAddINgravity[2] in newWhiteList: # if the domain we found added by user IS IN our new list count it 199 | userAddList[uA] = userAddINgravity[2] # add the domain we found to the list we created 200 | uagl = True 201 | uA += 1 # bump count if domain added (starts @ 0) 202 | # 203 | uA -= 1 # subtract 1 so the count doesn't put us out of range 204 | INgravityUSERaddListCount = uA # save our count here so we know how many we have later 205 | # Make us aware of User Added domains that are also in our script 206 | if uagl == True: # if we found user added domains from our list in gravity do: 207 | print ('[i] {} domain(s) added by the user that would be added by script.\n' .format(INgravityUSERaddListCount+1)) # we have to add 1 for humans cause count starts @ 0 208 | a = 0 209 | while uA >= 0: # remember that counter now we make it go backwards to 0 210 | a += 1 # counter for number output to screen 211 | print (' {}. {}' .format(a, userAddList[uA])) # Show us what we found 212 | uA -= 1 # go backwards 213 | else: # If we don't find any 214 | INgravityUSERaddListCount = 0 # make sure this is 0 215 | print ('[i] Found {} domains added by the user that would be added by script.' .format(INgravityUSERaddListCount)) # notify of negative result 216 | # 217 | # 218 | # Check Gravity database for domains added by script that are not in new script 219 | INgravityNOTnewList = [None] * gravScriptBeforeTUPlen # create a list that has the same size as the tuple is it compared to 220 | gravScriptBeforeList = [None] * gravScriptBeforeTUPlen 221 | z = 0 222 | if uagl == True: 223 | print('\n') 224 | 225 | print('[i] Checking Gravity for domains previously added by script that are NOT in new script.') 226 | ignl = False 227 | a = 0 228 | for INgravityNOTnew in gravScriptBeforeTUP: # for every domain previously added by script 229 | gravScriptBeforeList[a] = INgravityNOTnew[2] # take domains from gravity and put them in a list for later 230 | a += 1 231 | if not INgravityNOTnew[2] in newWhiteList: # make sure it is not in new script 232 | INgravityNOTnewList[z] = INgravityNOTnew # add not found to list for later 233 | ignl = True 234 | z += 1 235 | # 236 | z -= 1 237 | INgravityNOTnewListCount = z 238 | # If In Gravity because of script but NOT in the new list Prompt for removal 239 | if ignl == True: 240 | print ('[i] {} domain(s) added previously by script that are not in new script.\n' .format(INgravityNOTnewListCount+1)) 241 | a = 0 242 | while z >= 0: 243 | a += 1 244 | print (' deleting {}' .format(INgravityNOTnewList[z][2])) 245 | # print all data retrieved from database about domain to be removed 246 | # print (INgravityNOTnewList[z]) 247 | # ability to remove old 248 | sql_delete = " DELETE FROM domainlist WHERE type = 0 AND id = '{}' " .format(INgravityNOTnewList[z][0]) 249 | cursor.executescript(sql_delete) 250 | z -= 1 251 | # If not keep going 252 | else: 253 | INgravityNOTnewListCount = 0 254 | print ('[i] Found {} domain(s) added previously by script that are not in script.' .format(INgravityNOTnewListCount)) 255 | # 256 | # 257 | # Check Gravity database for new domains to be added by script 258 | INnewNOTgravityList = [None] * newWhiteListlen 259 | w = 0 260 | if ignl == True: 261 | print('\n') 262 | # 263 | print('[i] Checking script for domains not in Gravity.') 264 | ilng = False 265 | for INnewNOTgravity in newWhiteList: # for every domain in the new script 266 | if not INnewNOTgravity in gravScriptBeforeList and not INnewNOTgravity in userAddList: # make sure it is not in gravity or added by user 267 | INnewNOTgravityList[w] = INnewNOTgravity # add domain to list we created 268 | ilng = True 269 | w += 1 270 | # 271 | w -= 1 272 | INnewNOTgravityListCount = w 273 | # If there are domains in new list that are NOT in Gravity 274 | if ilng == True: # Add domains that are missing from new script and not user additions 275 | print ('[i] {} domain(s) NOT in Gravity that are in new script.\n' .format(INnewNOTgravityListCount+1)) 276 | a = 0 277 | while w >= 0: 278 | a += 1 279 | for addNewWhiteDomain in newWhiteList: 280 | if addNewWhiteDomain in INnewNOTgravityList: 281 | print (' - Adding {}' .format(addNewWhiteDomain)) 282 | # print (addNewWhiteDomain) 283 | sql_index = newWhiteList.index(addNewWhiteDomain) 284 | # print (sql_index) 285 | # print (nW[sql_index]) 286 | # ability to add new 287 | sql_add = " INSERT OR IGNORE INTO domainlist (type, domain, enabled, comment) VALUES {} " .format(nW[sql_index]) 288 | cursor.executescript(sql_add) 289 | w -= 1 290 | # Re-Check Gravity database for domains added by script after we update it 291 | gravityScript_after = cursor.execute(" SELECT * FROM domainlist WHERE type = 0 AND comment LIKE '%qjz9zk%' ") 292 | # fetch all matching entries which will create a tuple for us 293 | gravScriptAfterTUP = gravityScript_after.fetchall() 294 | # Number of domains in database from script 295 | gravScriptAfterTUPlen = len(gravScriptAfterTUP) 296 | 297 | gsa = False 298 | ASG = INnewNOTgravityListCount 299 | ASGCOUNT = 0 300 | gravScriptAfterList = [None] * gravScriptAfterTUPlen 301 | 302 | print ('\n[i] Checking Gravity for newly added domains.\n') 303 | 304 | for gravScriptAfterDomain in gravScriptAfterTUP: 305 | gravScriptAfterList[ASGCOUNT] = gravScriptAfterTUP[ASGCOUNT][2] 306 | ASGCOUNT += 1 307 | 308 | while ASG >= 0: 309 | if INnewNOTgravityList[ASG] in gravScriptAfterList: 310 | print(' - Found {} ' .format(INnewNOTgravityList[ASG])) 311 | gsa = True 312 | ASG = ASG - 1 313 | 314 | if gsa == True: 315 | # All domains are accounted for. 316 | print("\n[i] All {} missing domain(s) to be added by script have been discovered in Gravity." .format(newWhiteListlen)) 317 | 318 | else: 319 | print ("\n[i] All {} new domain(s) have not been added to Gravity." .format(INnewNOTgravityListCount+1)) 320 | 321 | else: # We should be done now 322 | # Do Nothing and exit. All domains are accounted for. 323 | print("[i] All {} domains to be added by script have been discovered in Gravity" .format(newWhiteListlen)) 324 | # Find total whitelisted domains (regex) 325 | total_domains_R = cursor.execute(" SELECT * FROM domainlist WHERE type = 2 ") 326 | tdr = len(total_domains_R.fetchall()) 327 | # Find total whitelisted domains (exact) 328 | total_domains_E = cursor.execute(" SELECT * FROM domainlist WHERE type = 0 ") 329 | tde = len(total_domains_E.fetchall()) 330 | total_domains = tdr + tde 331 | print("[i] There are a total of {} domains in your whitelist (regex({}) & exact({}))" .format(total_domains, tdr, tde)) 332 | sqliteConnection.close() 333 | print('[i] The database connection is closed') 334 | if ilng == True: 335 | print('[i] Restarting Pi-hole. This could take a few seconds') 336 | restart_pihole(args.docker) 337 | 338 | except sqlite3.Error as error: 339 | print('[X] Failed to insert domains into Gravity database', error) 340 | print('\n') 341 | print('\n') 342 | exit(1) 343 | 344 | finally: 345 | print('\n') 346 | print('Done. Happy ad-blocking :)') 347 | print('\n') 348 | print('Star me on GitHub: https://github.com/anudeepND/whitelist') 349 | print('Buy me a coffee: https://paypal.me/anudeepND') 350 | print('\n') 351 | 352 | else: 353 | 354 | if os.path.isfile(gravity_whitelist_location) and os.path.getsize(gravity_whitelist_location) > 0: 355 | print('[i] Collecting existing entries from whitelist.txt') 356 | with open(gravity_whitelist_location, 'r') as fRead: 357 | whitelist_local.update(x for x in map( 358 | str.strip, fRead) if x and x[:1] != '#') 359 | 360 | if whitelist_local: 361 | print("[i] {} existing whitelists identified".format( 362 | len(whitelist_local))) 363 | if os.path.isfile(anudeep_whitelist_location) and os.path.getsize(anudeep_whitelist_location) > 0: 364 | print('[i] Existing anudeep-whitelist install identified') 365 | with open(anudeep_whitelist_location, 'r') as fOpen: 366 | whitelist_old_anudeep.update(x for x in map( 367 | str.strip, fOpen) if x and x[:1] != '#') 368 | 369 | if whitelist_old_anudeep: 370 | print('[i] Removing previously installed whitelist') 371 | whitelist_local.difference_update(whitelist_old_anudeep) 372 | 373 | print("[i] Syncing with {}" .format(whitelist_remote_url)) 374 | whitelist_local.update(whitelist_remote) 375 | 376 | print("[i] Outputting {} domains to {}" .format( 377 | len(whitelist_local), gravity_whitelist_location)) 378 | with open(gravity_whitelist_location, 'w') as fWrite: 379 | for line in sorted(whitelist_local): 380 | fWrite.write("{}\n".format(line)) 381 | 382 | with open(anudeep_whitelist_location, 'w') as fWrite: 383 | for line in sorted(whitelist_remote): 384 | fWrite.write("{}\n".format(line)) 385 | 386 | print('[i] Done - Domains are now added to your Pi-Hole whitelist\n') 387 | print('[i] Restarting Pi-hole. This could take a few seconds') 388 | restart_pihole(args.docker) 389 | print('[i] Done. Happy ad-blocking :)') 390 | print('\n') 391 | print('Star me on GitHub: https://github.com/anudeepND/whitelist') 392 | print('Buy me a coffee: https://paypal.me/anudeepND') 393 | print('\n') 394 | --------------------------------------------------------------------------------