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!

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded in 2005.

Leave a Comment