r/pihole • • 5h ago

gravitywell: an unofficial, typed Python client for the Pi-hole v6 API, with an optional MCP server

Thumbnail
github.com
0 Upvotes

Up front: AI helped write the code. I drove the design and reviewed every change to make sure it matched my vision.

gravitywell is a third-party Python client for the Pi-hole v6 REST API. It isn't affiliated with or endorsed by the Pi-hole project.

import os
from gravitywell import PiHole, PiHoleAuth

auth = PiHoleAuth(os.environ["PIHOLE_PASSWORD"])

with PiHole("http://pi.hole", auth=auth) as api:
    print(api.stats.summary().queries.percent_blocked)
    api.dns.set_blocking(False, timer=300)  # pause for 5 minutes
  • Covers the whole API: blocking, domain rules, lists, groups, stats, the query log, settings, DHCP, logs, gravity updates, and backups.
  • Careful with sessions: it logs in once, reuses the session, and logs out when done, so it doesn't use up v6's small session limit.
  • Typed, sync and async: every response is a Pydantic model, and PiHole and AsyncPiHole have the same methods.
  • Optional MCP server: ask Claude or another AI assistant "why is this site blocked?" or "is my Pi-hole healthy?". It's read-only unless you pass --allow-writes or --allow-destructive.

It needs Python 3.12+ and Pi-hole v6, and I tested it against FTL v6.9.

I thought it was worth sharing. Feedback is welcome, especially if something doesn't work on your setup.


r/pihole • • 17h ago

holy apple dns spams - 161 domains from plugging a apple tv hd back in

53 Upvotes

List is as below from pihole

WTF apple...

DomainCount
xp.g.aaplimg.com19
bag.itunes.g.aaplimg.com18
ocsp2.g.aaplimg.com15
gateway.fe2.apple-dns.net12
gdmf.apple.com10
cdn-h3.g.aaplimg.com9
updates.cdn-apple.com8
e673.dsce9.akamaiedge.net7
gateway.icloud.com6
ocsp2.apple.com6
pds-init.ess.apple.com6
amp-api-search-edge.apps.apple.com5
amp-api.apps.apple.com5
configuration.ls.apple.com5
gspe35-ssl.ls.apple.com5
identity.ess.apple.com5
init-p01md.apple.com5
static.ess.apple.com5
app-site-association.cdn-apple.com4
bag-cdn.itunes-apple.com.akadns.net4
bookkeeper.itunes.apple.com4
fpinit-itunes.g.aaplimg.com4
fpinit-us-w.edge-itunes-apple.com.akadns.net4
is-ssl.mzstatic.com.itunes-apple.com.akadns.net4
itunes.apple.com4
itunes.apple.com.edgekey.net4
mask-api.icloud.com4
mesu-cdn.origin-apple.com.akadns.net4
pancake.apple.com4
s.mzstatic.com4
setup.fe2.apple-dns.net4
setup.icloud.com4
sylvan.apple.com4
time.apple.com4
updates.g.aaplimg.com4
xp.apple.com4
a1838.dscw154.akamai.net3
amp-api-edge-cdn-lb.itunes-apple.com.akadns.net3
api.smoot.apple.com3
apps-mzstatic-cdn.itunes-apple.com.akadns.net3
apps.mzstatic.com3
apps.mzstatic.com.g.aaplimg.com3
bag.itunes.apple.com3
bpapi.apple.com3
captive.apple.com3
cl3.apple.com3
entitlements.itunes.apple.com3
fpinit.itunes.apple.com3
gdmf-ados.apple.com3
gsa-gpk.apple.com3
gsa.apple.com3
gsas.apple.com3
gsp-ssl.ls.apple.com3
gspe21-ssl.ls.apple.com3
gspe35-cdn.v.aaplimg.com3
humb.apple.com3
init.itunes.apple.com3
init.push.apple.com3
lcdn-locator.apple.com3
messaging.metrics.icloud.com3
mesu.apple.com3
musicstatus.itunes.apple.com3
profile.ess.apple.com3
a1845.dscg2.akamai.net2
acsegateway.icloud.com2
amd-infra.itunes.apple.com2
amp-account.itunes.apple.com2
amp-api-edge-lb.itunes-apple.com.akadns.net2
amp-api-edge.apps.apple.com2
amp-api.media.apple.com2
buy.itunes-apple.com.akadns.net2
buy.itunes.apple.com2
client-api.itunes.apple.com2
configuration.apple.com2
doh.dns.apple.com2
edge-018.ussea3.icloud-content.com2
gateway-asset.icloud-content.com2
gs.apple.com2
gspe35-applecdn-cutover.ls-apple.com.akadns.net2
h3.apis.apple.map.fastly.net2
init.ess.apple.com2
is1-ssl.mzstatic.com2
ocsp.comodoca.com2
ocsp.digicert.com2
p116-acsegateway.icloud.com2
p22-buy.itunes.apple.com2
pd.itunes.apple.com2
pds.ess.apple.com2
profile.gc.apple.com2
query.ess.apple.com2
sandbox.itunes.apple.com2
se2.itunes.apple.com2
sf-api-token-service-lb.itunes-apple.com.akadns.net2
sf-api-token-service.itunes.apple.com2
sp.itunes.apple.com2
sync.itunes.apple.com2
threeplr-a3b98uo3r2cel7-0.api.amazonvideo.com2
ts.itunes.apple.com2
valid.apple.com2
16-courier2.push.apple.com1
34-courier2.push.apple.com1
41-courier2.push.apple.com1
afs.ampaeservices.com1
aidc.apple.com1
albert.apple.com1
amp-api-updates.apps.apple.com1
amp-api.music.apple.com1
app-site-association.g.aaplimg.com1
arcus-uswest.amazon.com1
auth.itunes.apple.com1
bag-cdn-lb.itunes-apple.com.akadns.net1
bookkeeper-itunes.g.aaplimg.com1
buylite.itunes.apple.com1
configuration.g.aaplimg.com1
edge-018.ussea3.ce.apple-dns.net1
experiments.apple.com1
friend.gc-apple.com.akadns.net1
friend.gc.apple.com1
gdmf.v.aaplimg.com1
gs-loc.apple.com1
gsa-gpk.idms-apple.com.akadns.net1
gspe1-ssl.ls.apple.com1
gsra.apple.com1
https://gateway.icloud.com1
identity-ess.v.aaplimg.com1
init-kt.apple.com1
init.gc.apple.com1
is-mzstatic-h3.g.aaplimg.com1
mask-api.fe2.apple-dns.net1
ml.cdn-apple.com1
musicstatus-us-w.edge-itunes-apple.com.akadns.net1
ocsp.edge.digicert.com1
p102-sharedstreams.icloud.com1
p103-sharedstreams.icloud.com1
p115-sharedstreams.icloud.com1
p124-sharedstreams.icloud.com1
p134-sharedstreams.icloud.com1
p139-sharedstreams.icloud.com1
p14-buy.itunes.apple.com1
p143-sharedstreams.icloud.com1
p149-sharedstreams.icloud.com1
p154-sharedstreams.icloud.com1
p159-sharedstreams.icloud.com1
p164-sharedstreams.icloud.com1
p174-content.icloud.com1
p182-content.icloud.com1
p22-buy-lb.itunes-apple.com.akadns.net1
pancake.g.aaplimg.com1
partiality.itunes.apple.com1
pd-cdn.itunes-apple.com.akadns.net1
play.itunes.apple.com1
profile-ess.v.aaplimg.com1
radio.itunes.apple.com1
static.gc.apple.com1
staticess.g.aaplimg.com1
stats.gc.apple.com1
stats.gc.fe2.apple-dns.net1
tdms.apple.com1
time.g.aaplimg.com1
updates-http.cdn-apple.com1
video-ssl.itunes.apple.com1

r/pihole • • 2h ago

I have a G3100 FiOS router with Verizon and am trying to get my pihole instance to show individual devices instead of everything coming from the router's IP address

2 Upvotes

I set up my pihole and so far most things seem fine. One thing I have been trying to figure out so I can troubleshoot things easier is get everything to show from their individual ip address instead of everything going through the router. I looked at everything I can think of in the G3100 router software to see what causes it to do that. I did see a post from a few years ago with a similar problem but their solution doesn't seem to work for me. Thanks in advance for any tips!