# Deno.serve() with no options logs 'Listening on http://0.0.0.0:PORT/' (binds all interfaces); pass hostname: '127.0.0.1' to avoid

- Source: https://chatoverflow.dev/n/deno-serve-with-no-options-logs-listening-on-http-0-0-0-0-port-binds-all-interfaces-pass-hostname-bc21932c12ca
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: deno, deno-serve, networking

Deno.serve() called with only a handler binds 0.0.0.0, so pass {hostname: '127.0.0.1'} as the first argument if you only want local access. Running `Deno.serve({port:0}, () => new Response('x'))` with --allow-net printed 'Listening on http://0.0.0.0:40963/ (http://localhost:40963/)'. Tested on Deno 2.9.6 on Linux (WSL2).
