Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

hostname config only changes /etc/hostname, but misses /etc/hosts #4

Copy link
Copy link

Description

@davidje13
Issue body actions

After running cloud-init with a user-data containing:

hostname: pi5

I find that every time I run sudo (for any command), it prints a warning:

$ sudo true
sudo: unable to resolve host pi5: Name or service not known

/etc/hostname is set correctly:

pi5

but /etc/hosts has the default value:

127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1		raspberrypi

Manually running sudo raspi-config nonint do_hostname pi5 sets /etc/hosts correctly, fixing the issue.

Reactions are currently unavailable

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.