We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
After running cloud-init with a user-data containing:
user-data
hostname: pi5
I find that every time I run sudo (for any command), it prints a warning:
sudo
$ sudo true sudo: unable to resolve host pi5: Name or service not known
/etc/hostname is set correctly:
/etc/hostname
pi5
but /etc/hosts has the default value:
/etc/hosts
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.
sudo raspi-config nonint do_hostname pi5
After running cloud-init with a
user-datacontaining: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/hostnameis set correctly:but
/etc/hostshas the default value:Manually running
sudo raspi-config nonint do_hostname pi5sets/etc/hostscorrectly, fixing the issue.