claude-memory/graph/problems/pi-hole-v6-dns-sync-script-needs-update-for-new-toml-config-dc3ed1.md
Cal Corum b140d4d82a migrate: 313 memories from MemoryGraph
- 313 new markdown files created
- 30 relationships embedded
- 313 entries indexed
- State initialized with usage data
2026-02-13 11:11:48 -06:00

59 lines
2.1 KiB
Markdown

---
id: dc3ed16c-18db-4011-b866-3730316cd68d
type: problem
title: "Pi-hole v6 DNS sync script needs update for new TOML config format"
tags: [pihole, npm, dns, sync, v6, toml, homelab, troubleshooting]
importance: 0.7
confidence: 0.8
created: "2026-02-07T15:12:17.978779+00:00"
updated: "2026-02-07T15:12:17.978779+00:00"
relations:
- target: fae8f322-d5c6-4ffb-9735-49e9f46940e8
type: SOLVES
direction: incoming
strength: 0.5
---
## Problem
The npm-pihole-sync.sh script at /mnt/NV2/Development/claude-home/server-configs/networking/scripts/npm-pihole-sync.sh is outdated for Pi-hole v6.
**What happened:**
- User removed pd.manticorum.com NPM proxy rule to route through Cloudflare
- Script synced NPM hosts but didn't remove pd.manticorum.com from Pi-hole DNS
- Caused continued 502 errors when accessing pd.manticorum.com API
**Root Cause:**
Pi-hole v6 changed DNS record storage:
- OLD (v5): /etc/pihole/custom.list
- NEW (v6): /etc/pihole/pihole.toml (dns.hosts array in TOML format) AND /etc/pihole/hosts/custom.list
**Manual Fix Applied:**
ssh pihole "docker exec pihole sed -i '/pd\.manticorum\.com/d' /etc/pihole/pihole.toml /etc/pihole/hosts/custom.list && docker exec pihole pihole reloaddns"
**Script Requirements:**
1. Update /etc/pihole/hosts/custom.list (traditional format)
2. Update /etc/pihole/pihole.toml hosts array (TOML format: hosts = ["IP DOMAIN", ...])
3. Use 'pihole reloaddns' instead of 'pihole restartdns reload'
4. Fix secondary pihole SSH (use IP with -o StrictHostKeyChecking=no instead of hostname)
**Challenges:**
- Pi-hole container has NO python3, NO perl
- Need pure shell/sed/awk solution
- TOML hosts array is multi-line regex replacement
**TOML Format:**
hosts = [
"10.10.0.16 domain1.com",
"10.10.0.16 domain2.com"
]
**Secondary Pihole:**
- IP: 10.10.0.226
- User: cal
- Need: ssh -o StrictHostKeyChecking=no cal@10.10.0.226
**Files:**
- Script: /mnt/NV2/Development/claude-home/server-configs/networking/scripts/npm-pihole-sync.sh
- Primary Pi-hole: 10.10.0.16 (pihole container)
- Secondary Pi-hole: 10.10.0.226 (pihole container)