# pihole as gateway

**URL:** <https://discourse.pi-hole.net/t/pihole-as-gateway/84796>\
**Category:** Feature Requests\
**Created:** [January 30, 2026, 5:53pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796 "2026-01-30T17:53:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![terxleben](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/t/cdc98d/32.png) [@terxleben](https://discourse.pi-hole.net/u/terxleben)\
**Post date:** [January 30, 2026, 5:53pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/1 "2026-01-30T17:53:55Z")

</div>

What if Pi-hole could also be used as a gateway proxy?

So, Pi-hole monitors x gateways on the internal network and automatically switches to another defined gateway if the main gateway fails? I'm only interested in failover, not load balancing, etc.

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [January 31, 2026, 5:42am UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/2 "2026-01-31T05:42:34Z")

</div>

Please elaborate - what gateways are you referring to?

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [January 31, 2026, 7:31am UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/3 "2026-01-31T07:31:24Z")

</div>

> [@terxleben](#):
>
> What if Pi-hole could also be used as a gateway proxy?

You'd need a router for that.  
As a DNS forwarder, Pi-hole is not involved in routing at all.

---

<div class="post-metadata">

**Author:** ![terxleben](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/t/cdc98d/32.png) [@terxleben](https://discourse.pi-hole.net/u/terxleben)\
**Post date:** [January 31, 2026, 1:14pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/4 "2026-01-31T13:14:09Z")

</div>

I believe gateway functionality is an essential part of Pi-hole. The idea is to use Pi-hole to perform transparent and simple router failover without having to change the default gateway on hosts. The plan is to configure a network-wide Pi-hole as the default gateway, checking the availability of two WAN routers and forwarding traffic to the second router instead of the first if necessary.

---

<div class="post-metadata">

**Author:** ![terxleben](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/t/cdc98d/32.png) [@terxleben](https://discourse.pi-hole.net/u/terxleben)\
**Post date:** [January 31, 2026, 1:19pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/5 "2026-01-31T13:19:37Z")

</div>

Setting this up via the CLI is quick and easy (enable IP forwarding and add an iptables entry). It's so simple that it could easily be done in the web interface.

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [January 31, 2026, 3:11pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/6 "2026-01-31T15:11:03Z")

</div>

> [@terxleben](#):
>
> I believe gateway functionality is an essential part of Pi-hole.

That belief is wrong: As already mentioned, Pi-hole is a not involved in routing at all.

There are specialised software packages or even entire OSs that focus on routing.  
But even if you'd use them: A home network typically has just a single one gateway that connects it to the Internet - providing a failover would be mute.

---

<div class="post-metadata">

**Author:** ![buntspexxt](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/b/e9bcb4/32.png) [@buntspexxt](https://discourse.pi-hole.net/u/buntspexxt)\
**Post date:** [January 31, 2026, 3:11pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/7 "2026-01-31T15:11:35Z")

</div>

Pi-hole is designed solely as a DNS sinkhole for name resolution, whereas gateway failover is a routing function that requires a dedicated router. It is not as simple as it sounds, especially when Pi-hole is running in Docker.

---

<div class="post-metadata">

**Author:** ![tomporter518](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/tomporter518/32/3504_2.png) [@tomporter518](https://discourse.pi-hole.net/u/tomporter518)\
**Post date:** [January 31, 2026, 4:09pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/8 "2026-01-31T16:09:18Z")

</div>

About the best one might hope to do is to dynamically adjust what Pi-hole’s (dnsmasq’s) DHCP would offer for gateway. But that’s for when a client requests an address.

---

<div class="post-metadata">

**Author:** ![terxleben](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/t/cdc98d/32.png) [@terxleben](https://discourse.pi-hole.net/u/terxleben)\
**Post date:** [January 31, 2026, 4:58pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/9 "2026-01-31T16:58:08Z")

</div>

@tomporter518, thanks for your thoughts.

That's precisely the nuisance I want to eliminate. A gateway failover in the shortest possible time, instead of potentially waiting 23 hours for a new DHCP lease. Not to mention static IPs. I usually run PH as a Debian-VM, which, in case of failure, is taken over by another within 30 seconds to ensure DNS/DHCP within the network.

If PH could use multiple gateways internally, the failure of a gateway router would be much easier and elegant to mitigate.

Apart from your idea, I haven't been able to find any discussion on this topic. Just "No”, “it's not possible", "Not planned," etc.

Therefore, I'll probably just set up a mini-Debian VM that provides a virtual gateway via IP forwarding, masking only the actual gatewayIPs. Or I'll use a bloated virtual OpenWRT, pfSense, or something similar that offers this out of the box. It's quite astonishing that nobody here is thinking about the essentiell triad of DNS/DHCP/GW and recognizing what might be missing.

---

<div class="post-metadata">

**Author:** ![terxleben](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/t/cdc98d/32.png) [@terxleben](https://discourse.pi-hole.net/u/terxleben)\
**Post date:** [January 31, 2026, 5:30pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/10 "2026-01-31T17:30:21Z")

</div>

PH is not only a DNS sinkhole but also a DHCP server. The next logical thought is to act as a GW alias. Someone thinks running the essential DNS/DHCP/GW services via Docker is something I would call extremely brave or stupid.  
:  
Furthermore, Docker uses IP forwarding intensively.

---

<div class="post-metadata">

**Author:** ![terxleben](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/t/cdc98d/32.png) [@terxleben](https://discourse.pi-hole.net/u/terxleben)\
**Post date:** [January 31, 2026, 5:43pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/11 "2026-01-31T17:43:14Z")

</div>

That's exactly why I suggested minimal routing/redirection as a very easy to implement but highly effective and reliable extension.  
Even though I'm anything but a fan of featuritis. You should think about easy-to-implement and useful extensions. Fortunately the underlying OS provides such functionalities.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [July 30, 2026, 5:43pm UTC](https://discourse.pi-hole.net/t/pihole-as-gateway/84796/12 "2026-07-30T17:43:44Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
