Files

3.1 KiB

name, description, version, author, license, platforms, metadata
name description version author license platforms metadata
openwrt-ap-dns-pihole Configure OpenWrt APs to use Pi-hole DNS. 1.0.0 Robert Rapp MIT
macos
linux
android
hermes
tags related_skills
openwrt
ap
dns
pi-hole
sophos
network

OpenWrt AP DNS Configuration for Pi-hole

Overview

When OpenWrt-based Access Points (AP100, AP50, or other OpenWrt firmware) are deployed on a network with Pi-hole, they may advertise their own DNS servers (often Cloudflare 1.1.1.1) via DHCP, causing clients to bypass Pi-hole filtering.

Problem Identified

Sophos AP100/AP50 (and other OpenWrt-based APs) at 192.168.178.208/209 were observed serving Cloudflare DNS (1.1.1.1) to all connected devices, bypassing the local Pi-hole at 192.168.178.35.

Solution: Configure APs to Use Pi-hole

  1. Access AP web interface:

    • AP1: http://192.168.178.208
    • AP2: http://192.168.178.209
  2. Navigate to DHCP/DNS settings:

    • Network → DHCP and DNS
    • Or: Services → DHCP Server
  3. Set custom DNS servers:

    • Enter Pi-hole IP: 192.168.178.35
    • Disable automatic DNS forwarding
    • Save and apply settings
  4. Reboot AP if prompted.

Method 2: CLI (SSH)

# SSH into AP
ssh admin@192.168.178.208

# Disable DNS forwarding and set Pi-hole as upstream
uci set dhcp.@dnsmasq[0].resolv='/etc/resolv.conf'
uci set dhcp.@dnsmasq[0].localservice='0'
uci commit
wifi reload

# Or set static DNS directly
uci set network.lan.dns='192.168.178.35'
uci commit
/etc/init.d/dnsmasq restart

Method 3: Disable AP DNS Entirely

If Pi-hole should be the sole DNS server:

# Disable dnsmasq DNS service
uci set dhcp.@dnsmasq[0].authoritative='0'
uci commit
/etc/init.d/dnsmasq stop
/etc/init.d/dnsmasq disable

Verification

After configuration, verify DNS resolution:

# Check current DNS
cat /etc/resolv.conf
# Should show nameserver 192.168.178.35 (Pi-hole)

# Test resolution
nslookup google.com 192.168.178.35

# Confirm APs no longer override
dig @192.168.178.208 google.com  # Should not return 1.1.1.1

Network Context

  • Pi-hole: 192.168.178.35 (dnsmasq 2.93)
  • Sophos APs: 192.168.178.208, 192.168.178.209 (OpenWrt firmware)
  • FRITZ!Box Gateway: 192.168.178.1 (NSD DNS)
  • Subnet: 192.168.178.0/24
  • touchdesigner-lampe: Lamp control via TouchDesigner sACN
  • lichtzentrale: WLED control via playbot
  • hermes-agent: Hermes Agent configuration

References

  • references/sophos-ap-dns-issue.md: Session-specific detail on Sophos AP DNS issue and resolution

Troubleshooting

AP unreachable after DNS change

  1. Verify AP IP address is correct
  2. Check that AP is on same VLAN/subnet
  3. Restart AP web interface/service

DNS still bypassing Pi-hole

  1. Clear DNS cache on clients: sudo systemd-resolve --flush-caches
  2. Reconnect clients to WiFi
  3. Verify AP settings were saved and applied

AP web interface login fails

  1. Use default credentials (check device documentation)
  2. Reset to factory defaults if needed

---
*Last updated: OpenWrt AP DNS configuration for Pi-hole integration*