Skip to content

Document container name vs hostname and network DNS#28822

Open
Honny1 wants to merge 1 commit into
podman-container-tools:mainfrom
Honny1:host-vs-name
Open

Document container name vs hostname and network DNS#28822
Honny1 wants to merge 1 commit into
podman-container-tools:mainfrom
Honny1:host-vs-name

Conversation

@Honny1
Copy link
Copy Markdown
Contributor

@Honny1 Honny1 commented Jun 1, 2026

Clarify that auto-generated names may use underscores, that DNS-enabled networks resolve container names as given, and that container_name_as_hostname changes the UTS hostname only.

Fixes: #28754

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

None

Clarify that auto-generated names may use underscores, that DNS-enabled
networks resolve container names as given, and that container_name_as_hostname
changes the UTS hostname only.

Fixes: podman-container-tools#28754

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
@packit-as-a-service
Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.


When << '**HostName=** is unset' if is_quadlet else '**--hostname** is not used' >> and the container uses a private UTS namespace (default), Podman sets the hostname to the first 12 characters of the container ID. The container name assigned with << '**ContainerName=**' if is_quadlet else '**--name**' >> is not used unless *container_name_as_hostname=true* is set in `containers.conf`.

Podman network DNS registers the container name, not this hostname. See **[podman-network(1)](podman-network.1.md)**.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not true? It should register both names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated hostname should separate hostname words with '-' instead of '_'

2 participants