diff --git a/docs/source/markdown/options/hostname.container.md b/docs/source/markdown/options/hostname.container.md index 4177a41c4b..ab7e76c9ed 100644 --- a/docs/source/markdown/options/hostname.container.md +++ b/docs/source/markdown/options/hostname.container.md @@ -4,6 +4,10 @@ ####> are applicable to all of those. #### **--hostname**, **-h**=*name* -Container host name +Set the container's hostname inside the container. -Sets the container host name that is available inside the container. Can only be used with a private UTS namespace `--uts=private` (default). If `--pod` is specified and the pod shares the UTS namespace (default) the pod's hostname is used. +This option can only be used with a private UTS namespace `--uts=private` +(default). If `--pod` is given and the pod shares the same UTS namespace +(default), the pod's hostname is used. The given hostname is also added to the +`/etc/hosts` file using the container's primary IP address (also see the +**--add-host** option). diff --git a/docs/source/markdown/options/hostname.pod.md b/docs/source/markdown/options/hostname.pod.md index 81efeaf2ba..4097bc922c 100644 --- a/docs/source/markdown/options/hostname.pod.md +++ b/docs/source/markdown/options/hostname.pod.md @@ -4,4 +4,7 @@ ####> are applicable to all of those. #### **--hostname**=*name* -Set a hostname to the pod. +Set the pod's hostname inside all containers. + +The given hostname is also added to the `/etc/hosts` file using the container's +primary IP address (also see the **--add-host** option). diff --git a/docs/source/markdown/options/name.container.md b/docs/source/markdown/options/name.container.md index 8f06e8d016..b7b454bc0b 100644 --- a/docs/source/markdown/options/name.container.md +++ b/docs/source/markdown/options/name.container.md @@ -12,7 +12,9 @@ The operator can identify a container in three ways: - UUID short identifier (“f78375b1c487”); - Name (“jonah”). -Podman generates a UUID for each container, and if a name is not assigned -to the container with **--name** then it generates a random -string name. The name can be useful as a more human-friendly way to identify containers. -This works for both background and foreground containers. +Podman generates a UUID for each container, and if no name is assigned to the +container using **--name**, Podman generates a random string name. The name can +be useful as a more human-friendly way to identify containers. This works for +both background and foreground containers. The container's name is also added +to the `/etc/hosts` file using the container's primary IP address (also see the +**--add-host** option). diff --git a/docs/source/markdown/options/no-hosts.md b/docs/source/markdown/options/no-hosts.md index 9ed32be7a5..ee033f4fe4 100644 --- a/docs/source/markdown/options/no-hosts.md +++ b/docs/source/markdown/options/no-hosts.md @@ -4,6 +4,12 @@ ####> are applicable to all of those. #### **--no-hosts** -Do not create _/etc/hosts_ for the <>. -By default, Podman manages _/etc/hosts_, adding the container's own IP address and any hosts from **--add-host**. -**--no-hosts** disables this, and the image's _/etc/hosts_ is preserved unmodified. +Do not modify the `/etc/hosts` file in the <>. + +Podman assumes control over the <>'s `/etc/hosts` file by +default and adds entries for the container's name (see **--name** option) and +hostname (see **--hostname** option), the internal `host.containers.internal` +and `host.docker.internal` hosts, as well as any hostname added using the +**--add-host** option. Refer to the **--add-host** option for details. Passing +**--no-hosts** disables this, so that the image's `/etc/hosts` file is kept +unmodified.