Cloud Dev Notes

infra diary / small notes / repeatable fixes

NAT Loopback: Why Hotspot Works but Home Wi‑Fi Fails

2026-02-15 · Networking

If you test a public IPv4 endpoint from the same LAN it is hosted on, the router has to do hairpin NAT (NAT loopback). Many consumer routers either do not support it well or behave inconsistently.

What it looks like

Your service works from outside (mobile hotspot), but fails from inside the home Wi‑Fi when you use the public domain or public IPv4 address.

Workarounds

1) Test from a real external network (hotspot).

2) Prefer IPv6 direct path inside the LAN when available.

3) Use split DNS for the internal network (internal name resolves to the LAN IP), if you control the local DNS.