sudo: Unable to resolve the host: reasons and solutions

  • Modify hostname
hostnamectl set-hostname master
bash

 

  • Reason: The ubuntu device name of the host is modified, and the hosts file is not configured later, causing linux to be unable to resolve to your host address
sudo: 无法解析主机:xxxxxx

 

  • Solution: It can be solved by configuring the hosts file. The specific operations are as follows:
sudo vim /etc/hosts

 

  • Modify the xxxx behind the number below to your current device name and save it.
127.0.1.1       xxxx


 

Guess you like

Origin blog.csdn.net/qq_924485343/article/details/114892099