Loopback address: definition and meaning

A loopback address is an IP address that sends traffic back to the same machine. IPv4 reserves the 127.0.0.0/8 block for it, usually used as 127.0.0.1, and IPv6 defines the single address ::1. Such traffic is meant to stay on the host.

Updated

A loopback address is an IP address that points back at the machine sending to it. Traffic sent to one is meant to stay on the host: it is not for a router, another machine, or the wider network.

The two ranges

  • IPv4: RFC 1122 defines { 127, <any> } as the internal host loopback address, which covers the whole 127.0.0.0/8 block, and says addresses of that form must not appear outside a host. Almost everything uses 127.0.0.1, but 127.0.0.2 and the rest of the block are loopback addresses by that definition too.
  • IPv6: RFC 4291 defines a single loopback address, ::1, which is 0:0:0:0:0:0:0:1 written short. It must not be assigned to a physical interface, and a packet received on an interface with ::1 as its destination must be dropped.

The RFCs define which addresses are loopback. They do not say how an operating system configures its loopback interface, so use 127.0.0.1 unless you have checked that another address in the block answers.

Bind address and destination

The loopback address matters most when you choose where a server listens. A server bound to a loopback address accepts connections only from programs on the same machine. A server bound to all interfaces can accept them from the network as well.

JavaScript
import http from "node:http";
const server = http.createServer((req, res) => res.end("ok"));

server.listen(3000, "127.0.0.1"); // IPv4 loopback only
// server.listen(3000, "::1");    // IPv6 loopback only
// server.listen(3000);           // no host: :: if IPv6 is available, else 0.0.0.0

The Node.js documentation describes that last default. Each loopback family is a separate address, so a listener on 127.0.0.1 does not answer connections to ::1, and a listener on ::1 does not answer connections to 127.0.0.1.

A common confusion

The localhost hostname and the loopback address are different layers. localhost is a name that resolves to loopback addresses. The loopback address is the IP-level destination that the name resolves to. Writing 127.0.0.1 in a URL skips name resolution and picks IPv4. Writing localhost lets the resolver decide.

Loopback is also not the same as 0.0.0.0. Binding to 0.0.0.0 binds to all local IPv4 interfaces, as ip(7) describes for the wildcard address, while a loopback bind covers one address only.

In Rig

  • Port checks: to decide whether a port is free, Rig tries to bind it on both 127.0.0.1 and ::. If either bind fails, the port counts as taken.
  • MCP hub: the hub listens on 127.0.0.1, port 47823 by default, so other machines cannot reach it. The port is configurable, and Rig moves to another port if the default is busy. An optional second listener on the Mac’s mesh address exists for a paired iPhone, and it is off on fresh installs.
  • Local HTTPS proxy: it listens on 127.0.0.1 and, when it can, on ::1.

Sources

  1. RFC 1122: Requirements for Internet hosts, communication layersOfficial documentation, checked 13 October 2026
  2. RFC 4291: IP version 6 addressing architectureOfficial documentation, checked 13 October 2026
  3. Node.js net: server.listenOfficial documentation, checked 13 October 2026
  4. Linux man page: ip(7)Official documentation, checked 13 October 2026
  5. Rig documentation: Common port conflicts (port checks confirmed in Rig’s source code)Rig source code, checked 13 October 2026
  6. Rig documentation: MCP tools list (hub listener confirmed in Rig’s source code)Rig source code, checked 13 October 2026
  7. Rig documentation: Local HTTPS (proxy listeners confirmed in Rig’s source code)Rig source code, checked 13 October 2026

See how Rig fits in

Rig is a Mac app that starts, stops, and watches the processes in a project from one window. The knowledge base explains each part in plain language.

Related

https://userig.app/glossary/loopback-address