Opened 4 weeks ago

Last modified 4 weeks ago

#37022 closed Uncategorized

manage.py runserver fails with "nodename nor servname provided" when run using an rfc6761 hostname — at Version 2

Reported by: Chris Rose Owned by:
Component: Utilities Version: 5.2
Severity: Normal Keywords: dns runserver
Cc: Chris Rose Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Chris Rose)

$ uv run manage.py runserver nomnom.dev.localhost:8441
Watching for file changes with StatReloader
2026-04-03T15:53:16.440737Z [info     ] Watching for file changes with StatReloader [django.utils.autoreload]
Performing system checks...

System check identified no issues (0 silenced).
Error: [Errno 8] nodename nor servname provided, or not known

nomnom.dev.localhost doesn't directly resolve in DNS, but it is a valid RFC 6761 special use domain.

I've attached my settings, and because ALLOWED_HOSTS is relevant, here's that value from manage.py shell:

uv run manage.py shell
45 objects imported automatically (use -v 2 for details).

Python 3.13.12 (main, Feb  3 2026, 17:53:27) [Clang 17.0.0 (clang-1700.6.3.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.conf import settings
>>> settings.ALLOWED_HOSTS
['nomnom.dev.localhost']
>>>

Change History (3)

by Chris Rose, 4 weeks ago

Attachment: settings.py added

comment:1 by Tim Graham, 4 weeks ago

The documentation for runserver says, "You can pass in an IP address and port number explicitly."

There's an example with localhost, but I don't know that hostnames are otherwise supported. Have you looked at the code to identify where you believe Django is at fault?

comment:2 by Chris Rose, 4 weeks ago

Description: modified (diff)

Nope. I've been utterly unable to get a stack trace to appear. --traceback did nothing for me either.

Note: See TracTickets for help on using tickets.
Back to Top