Pi-hole Part 3 - Install and Configure Pi-Hole
Install and Configure Pi-Hole
First we update Ubuntu and install Pi-Hole. Then we change the administrator password. The rest of the commands are used to whitelist important domains:
Major Vendors | Core Services | Streaming Platforms | |
Apple Microsoft |
CAs (OCSP and CRLs) Captchas CDNs NTP |
Amazon Prime Video Disney Plus Hulu Netflix Plex Spotify YouTube |
Social Media Apps | TV and Entertainment | Streaming Sports | |
Facebook FamilyAlbum Indeed |
LG Smart TV Nintendo Playstation Samsung Smart TV |
ESPN+ Fox Sports NBC Sports |
Assorted Applications | Network and IoT Devices | Websites | |
Dropbox Push 2FA Apps PW Managers (LastPass, 1PW, etc.) Signal Sophos Zoom |
Hue Nest Ring Ubiquiti |
ChatGPT Fiverr Fox News Github Maricopa & AZ Gov. SpeedTest Wikipedia Yelp |
sudo apt update sudo apt upgrade -y # Better install wget -O basic-install.sh https://install.pi-hole.net sudo bash basic-install.sh # YOLO install curl -sSL https://install.pi-hole.net | bash sudo pihole admin set password <PASSWORD>
### MAJOR VENDORS ###
### Apple ### sudo pihole --allow-regex \ '(\.|^)apple\.com$' \ '(\.|^)icloud\.com$' \ '(\.|^)itunes\.com$' \ '(\.|^)apple-dns\.net$' \ '(\.|^)aaplimg\.com$' \ '(\.|^)akadns\.net$' \ --comment 'Apple' ### Google ### sudo pihole --allow-regex \ '(\.|^)google\.com$' \ '(\.|^)gstatic\.com$' \ '(\.|^)googleapis\.com$' \ '(\.|^)googleusercontent\.com$' \ '(\.|^)gmail\.com$' \ '(\.|^)nest\.com$' \ '(\.|^)telephony\.goog$' \ --comment 'Google' ### Microsoft ### sudo pihole --allow-regex \ '(\.|^)microsoft\.com$' \ '(\.|^)microsoftonline\.com$' \ '(\.|^)msftauth\.net$' \ '(\.|^)msauth\.net$' \ '(\.|^)office\.com$' \ '(\.|^)office365\.com$' \ '(\.|^)outlook\.com$' \ '(\.|^)windows\.com$' \ '(\.|^)windowsupdate\.com$' \ '(\.|^)live\.com$' \ '(\.|^)skype\.com$' \ '(\.|^)msedge\.net$' \ '(\.|^)azure\.com$' \ '(\.|^)s-microsoft\.com$' \ --comment 'Microsoft'
### CORE SERVICES ###
### CAs - OCSP and CRLs ### sudo pihole --allow-regex \ '(\.|^)ocsp\.digicert\.com$' \ '(\.|^)ocsp1\.digicert\.com$' \ '(\.|^)ocsp2\.digicert\.com$' \ '(\.|^)ocsp3\.digicert\.com$' \ '(\.|^)ospcx\.digicert\.com$' \ '(\.|^)cdp1\.digicert\.com$' \ '(\.|^)cdp2\.digicert\.com$' \ '(\.|^)crl3\.digicert\.com$' \ '(\.|^)crl4\.digicert\.com$' \ '(\.|^)edge\.digicert\.com$' \ '(\.|^)status\.thawte\.com$' \ '(\.|^)cdp\.thawte\.com$' \ '(\.|^)status\.geotrust\.com$' \ '(\.|^)cdp\.geotrust\.com$' \ '(\.|^)status\.rapidssl\.com$' \ '(\.|^)cdp\.rapidssl\.com$' \ '(\.|^)ocsp\.quovadisglobal\.com$' \ '(\.|^)amazontrust\.com$' \ '(\.|^)o\.lencr\.org' \ '(\.|^)c\.lencr\.org' \ '(\.|^)crl\.entrust\.net$' \ '(\.|^)certificates\.godaddy\.com$' \ '(\.|^)crl\.godaddy\.com$' \ '(\.|^)ocsp\.godaddy\.com$' \ '(\.|^)certificates\.starfieldtech\.com$' \ '(\.|^)crl\.starfieldtech\.com$' \ '(\.|^)ocsp\.starfieldtech\.com$' \ '(\.|^)ocsp\.sectigo\.com$' \ '(\.|^)ocsp\.usertrust\.com$' \ '(\.|^)ocsp\.comodoca\.com$' \ '(\.|^)crl\.sectigo\.com$' \ '(\.|^)crl\.usertrust\.com$' \ '(\.|^)crl\.comodoca\.com$' \ --comment 'OCSP and CRLs' #### Captchas ### sudo pihole --allow-regex \ '(\.|^)challenges\.cloudflare
\.com$' \
'(\.|^)cloudflarechallenge
\.com$' \
'(\.|^)check\.ddos-guard\.net
$' \
'(\.|^)recaptcha\.net$' \
'(\.|^)hcaptcha
\.com$' \
'(\.|^)mtcaptcha
\.com$' \
'(\.|^)cutcaptcha
\.com$' \
--comment 'Captchas'
### CDNs ###
sudo pihole --allow-regex \
'(\.|^)akamaihd\.net$' \
'(\.|^)akamaitechnologies\.com$' \
'(\.|^)akamaized\.net$' \
'(\.|^)aspnetcdn\.com$' \
'(\.|^)cdn\.cloudflare\.net$' \
'(\.|^)cdnjs\.cloudflare\.com$' \
'(\.|^)cdn\.embedly\.com$' \
'(\.|^)cdn\.embed\.ly$' \
'(\.|^)cdn\.optimizely\.com$' \
'(\.|^)cdn2\.optimizely\.com$' \
'(\.|^)cdn3\.optimizely\.com$' \
'(\.|^)cdnjs\.cloudflare\.com$' \
'(\.|^)d2gatte9o95jao\.cloudfront\.net$' \
'(\.|^)jsdelivr\.net$' \
'(\.|^)s3\.amazonaws\.com$' \
'(\.|^)cdn-apple\.com$' \
'(\.|^)jwpcdn\.com$' \
'(\.|^)zencdn\.net$' \
'(\.|^)fastly\.net$' \
'(\.|^)widget-cdn\.rpxnow\.com$' \
'(\.|^)souqcdn\.com$' \
--comment 'CDNs'
### NTP ###
sudo pihole --allow-regex \
'(\.|^)time-a-g\.nist\.gov$' \
'(\.|^)time-b-g\.nist\.gov$' \
'(\.|^)time-c-g\.nist\.gov$' \
'(\.|^)time-d-g\.nist\.gov$' \
'(\.|^)time-e-g\.nist\.gov$' \
'(\.|^)time-a-wwv\.nist\.gov$' \
'(\.|^)time-b-wwv\.nist\.gov$' \
'(\.|^)time-c-wwv\.nist\.gov$' \
'(\.|^)time-d-wwv\.nist\.gov$' \
'(\.|^)time-e-wwv\.nist\.gov$' \
'(\.|^)time-f-wwv\.nist\.gov$' \
'(\.|^)time-a-b\.nist\.gov$' \
'(\.|^)time-b-b\.nist\.gov$' \
'(\.|^)time-c-b\.nist\.gov$' \
'(\.|^)time-d-b\.nist\.gov$' \
'(\.|^)time-e-b\.nist\.gov$' \
'(\.|^)time\.nist\.gov$' \
'(\.|^)utcnist\.colorado\.edu$' \
'(\.|^)utcnist2\.colorado\.edu$' \
'(\.|^)utcnist3\.colorado\.edu$' \
'(\.|^)pool\.ntp\.org$' \
'(\.|^)0\.north-america\.ntp\.org$' \
'(\.|^)1\.north-america\.ntp\.org$' \
'(\.|^)2\.north-america\.ntp\.org$' \
'(\.|^)3\.north-america\.ntp\.org$' \
'(\.|^)ntp\.ubuntu\.com$' \
'(\.|^)time\.google\.com$' \
'(\.|^)time\.google1\.com$' \
'(\.|^)time\.google2\.com$' \
'(\.|^)time\.google3\.com$' \
'(\.|^)time\.google4\.com$' \
'(\.|^)time\.android\.com$' \
--comment 'NTP'
### STREAMING PLATFORMS ###
### Amazon Prime Video ###
sudo pihole --allow-regex \
'(\.|^)unagi\.amazon\.com$' \
'(\.|^)unagi-na\.amazon\.com$' \
'(\.|^)mas-ext\.amazon\.com$' \
'(\.|^)mas-sdk\.amazon\.com$' \
'(\.|^)mas-ssr\.amazon\.com$' \
'(\.|^)fls-na\.amazon\.com$' \
'(\.|^)dcape-na\.amazon\.com$' \
'(\.|^)arcus-uswest\.amazon\.com$' \
'(\.|^)pins\.amazon\.com$' \
'(\.|^)pindorama\.amazon\.com$' \
'(\.|^)softwareupdates\.amazon\.com$' \
'(\.|^)prod\.amazoncrl\.com$' \
'(\.|^)amazonalexa\.amazon\.com$' \
'(\.|^)amazonvideo\.com$' \
'(\.|^)aiv-cdn\.net$' \
'(\.|^)pv-cdn\.net$' \
'(\.|^)fireoscaptiveportal\.com$' \
--comment 'Amazon Prime Video et al'
### Disney Plus ###
sudo pihole --allow-regex \
'(\.|^)disneyplus\.com$' \
'(\.|^)disney-plus\.net$' \
'(\.|^)media\.dssott\.com$' \
'(\.|^)bamgrid\.com$' \
'(\.|^)registerdisney\.go\.com$' \
'(\.|^)cws\.conviva\.com$' \
'(\.|^)disney-portal\.my\.onetrust\.com$' \
'(\.|^)disneyplus\.bn5x\.net$' \
--comment 'Disney Plus'
### Hulu ###
sudo pihole --allow-regex \
'(\.|^)hulu\.com$' \
'(\.|^)hulustream\.com$' \
'(\.|^)playback\.edge\.bamgrid\.com$' \
'(\.|^)cws-hulu\.conviva\.com$' \
'(\.|^)huluim\.com$' \
--comment 'Hulu'
### Netflix ###
sudo pihole --allow-regex \
'(\.|^)netflix\.com$' \
'(\.|^)netflix\.net$' \
'(\.|^)nflxso\.net$' \
'(\.|^)nflximg\.net$' \
'(\.|^)nflximg\.com$' \
'(\.|^)nflxext\.com$' \
'(\.|^)nflxvideo\.net$' \
--comment 'Netflix'
### Plex ###
sudo pihole --allow-regex \
'(\.|^)plex\.bz$' \
'(\.|^)plex\.tv$' \
'(\.|^)plexapp\.com$' \
--comment 'Plex'
### Spotify ###
sudo pihole --allow-regex \
'(\.|^)spotify\.com$' \
'(\.|^)spotifycdn\.com$' \
'(\.|^)spotifycdn\.net$' \
'(\.|^)scdn\.co$' \
--comment 'Spotify'
### YouTube ###
sudo pihole --allow-regex \
'(\.|^)youtube\.com$' \
'(\.|^)ytimg\.com$' \
'(\.|^)googlevideo\.com$' \
'(\.|^)ggpht.com$' \
--comment 'YouTube'
### SOCIAL MEDIA PLATFORMS ###
### Facebook ###
sudo pihole --allow-regex \
'(\.|^)facebook\.com$' \
'(\.|^)fbcdn\.net$' \
'(\.|^)facebook\.net$' \
'(\.|^)fbsbx\.com$' \
'(\.|^)fb.com$' \
'(\.|^)messenger\.com$' \
'(\.|^)m\.me$' \
'(\.|^)msngr\.com$' \
--comment 'Facebook'
### FamilyAlbum ###
sudo pihole --allow-regex \
'(\.|^)mitene\.us$' \
--comment 'FamilyAlbum'
### Indeed ###
sudo pihole --allow-regex \
'(\.|^)indeed\.com$' \
--comment 'Indeed'
### Instagram ###
sudo pihole --allow-regex \
'(\.|^)cdninstagram\.com$' \
'(\.|^)instagram\.com$' \
--comment 'Instagram'
### LinkedIn ###
sudo pihole --allow-regex \
'(\.|^)linkedin\.com$' \
'(\.|^)licdn\.com$' \
--comment 'LinkedIn'
### TV and Entertainment ###
### LG Smart TV ###
sudo pihole --allow-regex \
'(\.|^)lge\.com$' \
'(\.|^)lgtvcommon\.com$' \
'(\.|^)lgsmartplatform\.com$' \
'(\.|^)lgtvsdp\.com$' \
'(\.|^)lgeapi\.com$' \
'(\.|^)lgviot\.com$' \
'(\.|^)lgappstv\.com$' \
--comment 'LG Smart TV'
### Nintendo ###
sudo pihole --allow-regex \
'(\.|^)nintendo\.com$' \
'(\.|^)nintendo\.net$' \
'(\.|^)nintendowifi\.net$' \
--comment 'Nintendo'
### Playstation ###
sudo pihole --allow-regex \
'(\.|^)sonyentertainmentnetwork\.com$' \
'(\.|^)playstation\.com$' \
'(\.|^)playstation\.net$' \
'(\.|^)playstation\.com\.edgekey88\.net$' \
'(\.|^)playstation\.net\.edgekey88\.net$' \
--comment 'Playstation'
### Samsung Smart TV ###
sudo pihole --allow-regex \
'(\.|^)samsung\.com$' \
'(\.|^)samsungcloudsolution\.com$' \
'(\.|^)samsungcloudsolution\.net$' \
'(\.|^)samsungyosemite\.com$' \
'(\.|^)samsungosp\.com$' \
'(\.|^)samsungotn\.com$' \
'(\.|^)samsungqbe\.com$' \
'(\.|^)samsungosp\.com$' \
'(\.|^)samsunggrm\.com$' \
--comment 'Samsung Smart TV'
### STREAMING SPORTS ###
### ESPN ###
sudo pihole --allow-regex \
'(\.|^)espn\.com$' \
'(\.|^)espn\.net$' \
'(\.|^)espncdn\.com$' \
'(\.|^)auth\.adobe\.com$' \
'(\.|^)livepassdl\.conviva\.com$' \
'(\.|^)streams\.adobeprimetime\.com$' \
--comment 'ESPN'
### Fox Sports ###
sudo pihole --allow-regex \
'(\.|^)foxsports\.com$' \
'(\.|^)dpm\.demdex\.net$' \
'(\.|^)foxnet\.demdex\.net$' \
'(\.|^)foxentertainment\.hb\.otrdc\.net$' \
'(\.|^)tags\.tiqcdn\.com$' \
'(\.|^)api\.segment\.io$' \
'(\.|^)bam\.nr-data\.net$' \
--comment 'Fox Sports'
### NBC Sports ###
sudo pihole --allow-regex \
'(\.|^)nbcsports\.com$' \
'(\.|^)identity\.mparticle\.com$' \
--comment 'NBC Sports'
### ASSORTED APPLICATIONS ###
### Dropbox ###
sudo pihole --allow-regex \
'(\.|^)dropbox\.com$' \
'(\.|^)dropboxusercontent\.com$' \
--comment 'Dropbox'
### Push 2FA ###
sudo pihole --allow-regex \
'(\.|^)passly\.com$' \
'(\.|^)duo\.com$' \
'(\.|^)duosecurity\.com$' \
'(\.|^)duofederal\.com$' \
'(\.|^)okta\.com$' \
'(\.|^)oktacdn\.com$' \
'(\.|^)okta-gov\.com$' \
'(\.|^)okta-featureflag-edge\.azureedge\.net$' \
--comment 'Push 2FA'
### Password Managers ###
sudo pihole --allow-regex \
'(\.|^)lastpass\.com$' \
'(\.|^)1password\.com$' \
'(\.|^)1passwordservices\.com$' \
'(\.|^)1passwordusercontent\.com$' \
'(\.|^)agilebits\.com$' \
'(\.|^)api\.privacy\.com$' \
'(\.|^)api\.pwnedpasswords\.com$' \
'(\.|^)1infra\.net$' \
'(\.|^)bitwarden\.com$' \
'(\.|^)dashlane\.com$' \
--comment 'Password Managers'
### Signal ###
sudo pihole --allow-regex \
'(\.|^)signal\.org$' \
'(\.|^)signal\.group$' \
'(\.|^)signal\.link$' \
'(\.|^)signal\.me$' \
'(\.|^)signal\.tube$' \
'(\.|^)textsecure-service-whispersystems\.org$' \
'(\.|^)whispersystems\.org$' \
--comment 'Signal'
### Sophos ###
sudo pihole --allow-regex \
'(\.|^)sophos\.com$' \
'(\.|^)sophosupd\.com$' \
'(\.|^)sophosupd\.net$' \
'(\.|^)sophosxl\.net$' \
'(\.|^)hitmanpro\.com$' \
'(\.|^)darkbytes\.io$' \
--comment 'Sophos'
### Zoom ###
sudo pihole --allow-regex \
'(\.|^)zoom\.com$' \
'(\.|^)zoom\.us$' \
'(\.|^)zoomapp\.cloud$' \
--comment 'Zoom'
### NETWORK AND IOT DEVICES ###
### Phillips Hue ###
sudo pihole --allow-regex \
'(\.|^)dc1\.philips\.com$' \
'(\.|^)philips-hue\.com$' \
'(\.|^)diagnostics\.meethue\.com$' \
'(\.|^)ws\.meethue\.com$' \
'(\.|^)ecdinterface.philips.com' \
--comment 'Philips Hue'
### Nest ###
sudo pihole --allow-regex \
'(\.|^)nest\.com$' \
'(\.|^)dropcam\.com$' \
'(\.|^)googlenestcommunity\.com$' \
--comment 'Nest'
### Ring ###
sudo pihole --allow-regex \
'(\.|^)ring\.com$' \
'(\.|^)crashlytics\.com$' \
'(\.|^)rings\.solutions$' \
'(\.|^)blinkforhome\.com$' \
'(\.|^)immedia-semi\.com$' \
--comment 'Ring'
### Ubiquiti ###
sudo pihole --allow-regex \
'(\.|^)ui\.com$' \
'(\.|^)ubnt\.com$' \
'(\.|^)unifi-ai\.com$' \
'(\.|^)ip-api\.com$' \
'(\.|^)0\.ubnt\.pool\.ntp\.org$' \
'(\.|^)1\.ubnt\.pool\.ntp\.org$' \
'(\.|^)2\.ubnt\.pool\.ntp\.org$' \
'(\.|^)3\.ubnt\.pool\.ntp\.org$' \
'(\.|^)ubnt\.pool\.ntp\.org$' \
--comment 'Ubiquiti'
### WEBSITES ###
### Banks ###
sudo pihole --allow-regex \
'(\.|^)jpmorganchase\.com$' \
'(\.|^)bankofamerica\.com$' \
'(\.|^)citigroup\.com$' \
'(\.|^)citi\.com$' \
'(\.|^)wellsfargo\.com$' \
'(\.|^)usbank\.com$' \
'(\.|^)goldmansachs\.com$' \
'(\.|^)pnc\.com$' \
'(\.|^)truist\.com$' \
'(\.|^)capitalone\.com$' \
'(\.|^)td\.com$' \
'(\.|^)morganstanley\.com$' \
--comment 'Banks'
### ChatGPT ###
sudo pihole --allow-regex \
'(\.|^)chatgpt\.com$' \
'(\.|^)browser-intake-datadoghq\.com$' \
'(\.|^)openai\.com$' \
'(\.|^)oaistatic\.com$' \
'(\.|^)oaiusercontent\.com$' \
--comment 'ChatGPT'
### Fiverr ###
sudo pihole --allow-regex \
'(\.|^)fiverr\.com$' \
'(\.|^)cdn0\.forter\.com$' \
'(\.|^)cdn3\.forter\.com$' \
'(\.|^)cdn4\.forter\.com$' \
'(\.|^)cdn8\.forter\.com$' \
'(\.|^)cdn8\.forter\.com$' \
'(\.|^)cdn123\.forter\.com$' \
--comment 'Fiverr'
### Fox News ###
sudo pihole --allow-regex \
'(\.|^)foxnews\.com$' \
'(\.|^)foxbusiness\.com$' \
(\.|^)fcnstatic\.com$' \
--comment 'Fox News'
### Github ###
sudo pihole --allow-regex \
'(\.|^)github\.com$' \
'(\.|^)github\.io$' \
'(\.|^)githubusercontent\.com$' \
--comment 'Github'
### Maricopa & AZGov ###
sudo pihole --allow-regex \
'(\.|^)maricopa\.gov$' \
'(\.|^)maricopa\.edu$' \
'(\.|^)mesacc\.edu$' \
'(\.|^)arizona\.gov$' \
'(\.|^)az\.gov$' \
'(\.|^)azdot\.gov$' \
'(\.|^)azdhs\.gov$' \
'(\.|^)azdor\.gov$' \
'(\.|^)azsos\.gov$' \
'(\.|^)azwater\.gov$' \
'(\.|^)azica\.gov$' \
--comment 'Maricopa and AZ'
### Reddit ###
sudo pihole --allow-regex \
'(\.|^)reddit\.com$' \
'(\.|^)redditstatic\.com$' \
'(\.|^)redd\.it$' \
'(\.|^)redditmedia\.com$' \
'(\.|^)reddit\.map\.fastly\.net$' \
'(\.|^)redditspace\.com$' \
--comment 'Reddit'
### SpeedTest ###
sudo pihole --allow-regex \
'(\.|^)usbrowserspeed\.com$' \
'(\.|^)speedtest\.net$' \
'(\.|^)ooklaserver\.net$' \
'(\.|^)cdnst\.net$' \
'(\.|^)speedtestcustom\.com$' \
--comment 'SpeedTest'
### Wikipedia ###
sudo pihole --allow-regex \
'(\.|^)wikipedia\.com$' \
'(\.|^)wikipedia\.org$' \
'(\.|^)wikimedia\.org$' \
--comment 'Wikipedia'
### Yelp ###
sudo pihole --allow-regex \
'(\.|^)yelp\.com$' \
'(\.|^)yelpcdn\.com$' \
'(\.|^)yelp\.to$' \
'(\.|^)app\.adjust\.com$' \
'(\.|^)app\.us\.adjust\.com$' \
'(\.|^)cdn\.adjust\.com$' \
--comment 'Yelp'