|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Pi-hole Syncing… But Smarter..." |
| 4 | +date: 2025-03-20 08:00:00 -0500 |
| 5 | +categories: homelab |
| 6 | +tags: homelab pihole self-hosted |
| 7 | +image: |
| 8 | + path: /assets/img/headers/pihole-sync-nebula-hero.webp |
| 9 | + lqip: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAUACgMBEQACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APyC/YF+PPwx8KfsJ/FjWrr9lH4JavqPgbwpZy67qYufH9trnxGuYdCHhSwk8Sa5feLdZ1HSLT+0Wi8WarongyXw1oN9rRvG0/S9FF1HJa/nWYZnh8DnzymrlOAx2IzydLC4PMMVGdWeUypYinXniKVCq6qnWrRqVKdSphKuW1akfYxrVa1ChDDn9OcPZBmWL4X4T4py/inO8mp5NDG4jGZRg50YYXMo0KMoxop0IYalGmqcIQpwzbC57SoydarSpRq4irN/z0+INWj1fXtb1aHStO0eHU9X1LUYtI00XkunaVHe3k1ymm2Eur3eqarJZWKyi1tZNT1PUdQeCKNr2+u7ky3En39KlTjSpxUdI04RXvVNlFJbzb+9v1PyHFYqpVxOIq1Hz1KlerUnOUKHNKc6kpSk+WhGN5Sbb5Yxjd6RS0P/2Q== |
| 10 | +--- |
| 11 | + |
| 12 | +Running multiple Pi-hole servers has always been a challenge, until now. In this video, I’ll show you a tool called Nebula Sync that helps keep them in sync, making DNS and blocklist management much easier. I'll walk through how it works, how to set it up, how to choose the right settings, and why it might be useful for your network. |
| 13 | + |
| 14 | +{% include embed/youtube.html id='OcSBggDyeJ4' %} |
| 15 | +📺 [Watch Video](https://www.youtube.com/watch?v=OcSBggDyeJ4) |
| 16 | + |
| 17 | +## Info |
| 18 | + |
| 19 | +Don't forget to give these repos a star! |
| 20 | + |
| 21 | +- <https://github.com/pi-hole/pi-hole> |
| 22 | +- <https://github.com/lovelaze/nebula-sync> |
| 23 | + |
| 24 | +What you'll need to get started |
| 25 | + |
| 26 | +- 2 fully working [Pi-hole servers](https://pi-hole.net/) |
| 27 | +- [Docker running](/posts/docker-compose-install/) somewhere in your environment |
| 28 | + |
| 29 | +Also, I mentioned that I would show you how to reset your Pi-hole password in the video, but never showed how 😅. |
| 30 | + |
| 31 | +Here's how: |
| 32 | + |
| 33 | +ssh into your Pi-hole server. |
| 34 | + |
| 35 | +```bash |
| 36 | +sudo pihole setpassword |
| 37 | +``` |
| 38 | + |
| 39 | +Your password will instantly be updated. |
| 40 | + |
| 41 | +## Instructions |
| 42 | + |
| 43 | +ssh into server. |
| 44 | + |
| 45 | +I usually put my stacks into `/opt/stacks`. |
| 46 | + |
| 47 | +Make a new directory for Nebula Sync and `cd` into it. |
| 48 | + |
| 49 | +```bash |
| 50 | +mkdir nebula-sync |
| 51 | +cd nebula-sync |
| 52 | +``` |
| 53 | + |
| 54 | +Create our compose file. |
| 55 | + |
| 56 | +```bash |
| 57 | +nano compose.yaml |
| 58 | +``` |
| 59 | + |
| 60 | +Inside of our `compose.yaml` paste: |
| 61 | + |
| 62 | +```yaml |
| 63 | +--- |
| 64 | +services: |
| 65 | + nebula-sync: |
| 66 | + image: ghcr.io/lovelaze/nebula-sync:latest |
| 67 | + container_name: nebula-sync |
| 68 | + env_file: .env |
| 69 | +``` |
| 70 | +
|
| 71 | +Create our `.env` with our variables. |
| 72 | + |
| 73 | +Replace with your server IPs, passwords, timezone, and how frequently you want so run this sync job. |
| 74 | + |
| 75 | +```bash |
| 76 | +PRIMARY=https://192.168.60.10|abc123 |
| 77 | +REPLICAS=https://192.168.60.26|abc123,https://10.0.200.5|abc123,https://10.0.200.6|abc123 |
| 78 | +FULL_SYNC=false |
| 79 | +RUN_GRAVITY=false |
| 80 | +CRON=*/15 * * * * |
| 81 | +
|
| 82 | +CLIENT_SKIP_TLS_VERIFICATION=true |
| 83 | +
|
| 84 | +TZ=America/Chicago |
| 85 | +
|
| 86 | +SYNC_CONFIG_DNS=true |
| 87 | +SYNC_CONFIG_DHCP=false |
| 88 | +SYNC_CONFIG_NTP=false |
| 89 | +SYNC_CONFIG_RESOLVER=false |
| 90 | +SYNC_CONFIG_DATABASE=false |
| 91 | +SYNC_CONFIG_MISC=false |
| 92 | +SYNC_CONFIG_DEBUG=false |
| 93 | +
|
| 94 | +SYNC_GRAVITY_DHCP_LEASES=false |
| 95 | +SYNC_GRAVITY_GROUP=false |
| 96 | +SYNC_GRAVITY_AD_LIST=true |
| 97 | +SYNC_GRAVITY_AD_LIST_BY_GROUP=true |
| 98 | +SYNC_GRAVITY_DOMAIN_LIST=true |
| 99 | +SYNC_GRAVITY_DOMAIN_LIST_BY_GROUP=true |
| 100 | +SYNC_GRAVITY_CLIENT=false |
| 101 | +SYNC_GRAVITY_CLIENT_BY_GROUP=false |
| 102 | +``` |
| 103 | + |
| 104 | +Start our compose stack interactively to monitor logs. |
| 105 | + |
| 106 | +```bash |
| 107 | +docker compose up |
| 108 | +``` |
| 109 | + |
| 110 | +Start our compose stack as a daemon. |
| 111 | + |
| 112 | +```bash |
| 113 | +docker compose up -d |
| 114 | +``` |
| 115 | + |
| 116 | +Checking for the running container |
| 117 | + |
| 118 | +```bash |
| 119 | +docker ps | grep nebula |
| 120 | +``` |
| 121 | + |
| 122 | +Check container logs |
| 123 | + |
| 124 | +```bash |
| 125 | +docker logs nebula-sync |
| 126 | +``` |
| 127 | + |
| 128 | +### Blocklists |
| 129 | + |
| 130 | +Here is the list of blocklists that I use. Use these with caution and prepare to add exceptions for sites you may need. |
| 131 | + |
| 132 | +Most of these were collected from <https://firebog.net/> |
| 133 | + |
| 134 | +```list |
| 135 | +https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts |
| 136 | +
|
| 137 | +https://mirror1.malwaredomains.com/files/justdomains |
| 138 | +
|
| 139 | +https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts_without_controversies.txt |
| 140 | +
|
| 141 | +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts |
| 142 | +
|
| 143 | +https://v.firebog.net/hosts/static/w3kbl.txt |
| 144 | +
|
| 145 | +https://adaway.org/hosts.txt |
| 146 | +
|
| 147 | +https://v.firebog.net/hosts/Prigent-Ads.txt |
| 148 | +
|
| 149 | +https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareHosts.txt |
| 150 | +
|
| 151 | +https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt |
| 152 | +
|
| 153 | +https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser |
| 154 | +
|
| 155 | +https://phishing.army/download/phishing_army_blocklist_extended.txt |
| 156 | +
|
| 157 | +https://v.firebog.net/hosts/AdguardDNS.txt |
| 158 | +
|
| 159 | +https://v.firebog.net/hosts/Admiral.txt |
| 160 | +
|
| 161 | +https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt |
| 162 | +
|
| 163 | +https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt |
| 164 | +
|
| 165 | +https://v.firebog.net/hosts/Easylist.txt |
| 166 | +
|
| 167 | +https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext |
| 168 | +
|
| 169 | +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts |
| 170 | +
|
| 171 | +https://raw.githubusercontent.com/bigdargon/hostsVN/master/hosts |
| 172 | +
|
| 173 | +https://v.firebog.net/hosts/Easyprivacy.txt |
| 174 | +
|
| 175 | +https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt |
| 176 | +
|
| 177 | +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts |
| 178 | +
|
| 179 | +https://urlhaus.abuse.ch/downloads/hostfile/ |
| 180 | +
|
| 181 | +https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts.txt |
| 182 | +
|
| 183 | +https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts |
| 184 | +
|
| 185 | +https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt |
| 186 | +
|
| 187 | +https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt |
| 188 | +
|
| 189 | +https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/AmazonFireTV.txt |
| 190 | +
|
| 191 | +https://v.firebog.net/hosts/Prigent-Malware.txt |
| 192 | +
|
| 193 | +https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt |
| 194 | +
|
| 195 | +https://someonewhocares.org/hosts/zero/hosts |
| 196 | +
|
| 197 | +https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts |
| 198 | +
|
| 199 | +https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt |
| 200 | +
|
| 201 | +https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt |
| 202 | +
|
| 203 | +https://v.firebog.net/hosts/Prigent-Crypto.txt |
| 204 | +
|
| 205 | +https://mirror.cedia.org.ec/malwaredomains/immortal_domains.txt |
| 206 | +
|
| 207 | +https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a1308f2f12394abd86d0927a4a0/bad_lists/Mandiant_APT1_Report_Appendix_D.txt |
| 208 | +
|
| 209 | +https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt |
| 210 | +
|
| 211 | +https://v.firebog.net/hosts/Shalla-mal.txt |
| 212 | +
|
| 213 | +https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt |
| 214 | +
|
| 215 | +https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts |
| 216 | +
|
| 217 | +https://winhelp2002.mvps.org/hosts.txt |
| 218 | +
|
| 219 | +https://v.firebog.net/hosts/neohostsbasic.txt |
| 220 | +
|
| 221 | +https://raw.githubusercontent.com/RooneyMcNibNug/pihole-stuff/master/SNAFU.txt |
| 222 | +
|
| 223 | +https://paulgb.github.io/BarbBlock/blacklists/hosts-file.txt |
| 224 | +
|
| 225 | +https://phishing.army/download/phishing_army_blocklist.txt |
| 226 | +
|
| 227 | +https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt |
| 228 | +
|
| 229 | +https://malware-filter.gitlab.io/malware-filter/phishing-filter-hosts.txt |
| 230 | +
|
| 231 | +https://v.firebog.net/hosts/RPiList-Malware.txt |
| 232 | +
|
| 233 | +https://v.firebog.net/hosts/RPiList-Phishing.txt |
| 234 | +
|
| 235 | +https://raw.githubusercontent.com/AssoEchap/stalkerware-indicators/master/generated/hosts |
| 236 | +
|
| 237 | +``` |
| 238 | + |
| 239 | +## Links |
| 240 | + |
| 241 | +🛍️ Check out the new Merch Shop at <https://l.technotim.live/shop> |
| 242 | + |
| 243 | +⚙️ See all the hardware I recommend at <https://l.technotim.live/gear> |
| 244 | + |
| 245 | +🚀 Don't forget to check out the [🚀Launchpad repo](https://l.technotim.live/quick-start) with all of the quick start source files |
| 246 | + |
| 247 | +🤝 Support me and [help keep this site ad-free!](/sponsor) |
0 commit comments