In my Japanese apartment I fixed a home network DNS server issue that kept blocking my codex authentication when the auth expired every few days.
The workaround previously was to disconnect the machine from the network, use a mobile hotspot to authenticate, then reconnect.
Symptoms:
- Codex authentication intermittently failed.
- Browser and
curlcould not resolve domains. ping 8.8.8.8worked.ping google.comfailed.curl ifconfig.me→ “Could not resolve host”.- Switching to phone hotspot temporarily fixed the issue.
IP routing worked, confirmed by ping 8.8.8.8.
I verified that DNS failed e.g. ping google.com failed and curl ifconfig.me failed.
I also attempted resolvectl status and resolvectl query google.com which failed.
I don’t know much about networking but it seemed like the router’s advertised DNS server at 192.168.11.1 was broken/not routing correctly.
Once I overrode DHCP-provided DNS with public ones e.g.
1.1.1.1
8.8.8.8
and flushed cached resolver state:
sudo resolvectl flush-cachesimmediately DNS began working again.
The Long-Term Fix
I configured the router to forward DNS to reliable upstream servers:
- Cloudflare: 1.1.1.1 / 1.0.0.1
- Google: 8.8.8.8 / 8.8.4.4
instead of relying on the ISP DNS.
Lessons Learned
- IP connectivity != DNS connectivity.
- Always test IP first (
ping 8.8.8.8) before debugging applications. - If IP works but names fail, investigate DNS immediately.
systemd-resolvedis rarely the root cause—it usually exposes a broken upstream resolver.- Public DNS servers are useful both as a diagnostic tool and as a long-term reliability improvement.