Skip to content

Hosts class should distinguish between fqdn and aliases #143

@carbonin

Description

@carbonin

The /etc/hosts man page (http://man7.org/linux/man-pages/man5/hosts.5.html) describes a difference between the "canonical_hostname" (fqdn) and the aliases for that hostname.

The LinuxAdmin::Hosts class should expose that difference in its API. Maybe a method to specifically set the first name in the list and then a separate one that appends to the aliases?

This difference is reflected in the behaviour of some external tools such as cloud-init and freeipa.
These tools will retrieve the hostname (typically via the hostname command or from /etc/hostname) then consult /etc/hosts to find the fqdn by taking the name in the "canonical_hostname" place in the line where the found hostname is an alias.

This can cause problems when the application acts differently based on whether the fqdn is "localhost" or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions