21

I installed Windows 10 Anniversary update and the Linux subsystem. When running anything with sudo it takes ages and then I get this error message:

sudo: unable to resolve host MYMACHINE

How to get rid of this and make sudo fast?

40

You have to edit /etc/hosts while superuser and add your machine name after the first line with localhost

127.0.0.1        localhost MYMACHINE

This will make the system not try to resolve the hostname from DNS.

  • Yup, that worked for me. – pooter03 Aug 3 '16 at 14:21
3

You can also remove /etc/hosts and restart bash to generate a version that contains your hostname. For me, it created a line with my computer name and my fully qualified name 127.0.0.1 fbc-2000.domain.local fbc-2000

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.