Bash Error “Unable to resolve host” (Bash on Ubuntu on Windows)

When you run the Sudo command the Bash console (Bash on Ubuntu on Windows), the following error may occur.

sudo: unable to resolve host

bash host name not resolved

To resolve the problem, run these commands in the Bash console

sudo su
echo computer_name >> /etc/hosts

That should fix the host name resolution!

About the author

Ramesh Srinivasan founded back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.

Leave a Comment