C.W.K.
Stream
Lesson 01 of 05 · published

What 0.0.0.0 vs 127.0.0.1 vs 192.168.x.x Actually Means

~15 min · bind, 0.0.0.0, tailscale-ip

Level 0Greenhorn
0 XP0/53 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

The single most consequential line in your config file is the host you bind to. Almost every "I got owned" solo-dev story starts with the wrong choice here. Three values cover 99% of the cases, and they are wildly different.

Bind addressWhat it meansWho can reach you
127.0.0.1 (loopback)"Only this machine"Only processes on the same OS
192.168.1.42 (specific LAN IP)"Reach me on this LAN address"Devices on the same LAN that know the IP
100.64.x.x (Tailscale CGNAT range)"Reach me through Tailscale only"Devices in your tailnet (after WireGuard handshake)
0.0.0.0 (all interfaces)"Listen on every NIC, including public"Anyone who can route a packet to any IP this host has

What 0.0.0.0 really does

It tells the OS: "accept connections on any interface this machine has." On a typical home Mac with one Wi-Fi NIC, the host might have:

  • 127.0.0.1 (loopback) — internal only.
  • 192.168.1.42 (Wi-Fi LAN) — reachable from your router's clients.
  • 100.64.0.5 (Tailscale) — reachable through your tailnet.
  • A potential public IPv6 if your ISP gives you one and your firewall isn't blocking.

Bind to 0.0.0.0 and the service answers on all four. The instant your router has UPnP enabled (it does, by default) and an inbound rule appears (it might), your "local" service is on the public internet.

External links

Exercise

Look at every dev server config in a project of yours: HOST or HOSTNAME or --host or bind: in YAML. List each one's value. For each 0.0.0.0, decide: should this be 127.0.0.1, a Tailscale IP, or stay 0.0.0.0 with a documented reason? Make at least one change today.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.