Skip to content
ohsudo, Home

Tags

#cloud-init

sudo: unable to resolve host
Linux

"sudo: unable to resolve host": fix /etc/hosts after a hostname change

Fix "sudo: unable to resolve host … Name or service not known" on Ubuntu and Debian: add the hostname to /etc/hosts, and keep cloud-init from undoing it.

Beginner · 3 min read