- Code: Select all
sudo vi /etc/hostname
I rebooted and all appeared fine until I needed to run a sudo command. The command will run, and it says that it is unable to resolve the hostname now. I did some checking and it says that I need to make sure I also modify the /etc/hosts file to include the new host name. Below is my host file.
- Code: Select all
127.0.0.1 localhost
127.0.1.1 sam-linux
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
~
Sam-linux is the new host, and it is below localhost, but still generates the error message. What else am I missing?? Is the IP address correct for sam-linux? The actual IP will vary each time I log into a different network but in some of the examples, I have seen 127.0.0.6, others 127.0.0.1... so I'm not sure what it should be.
Thanks,
John


