Sunday, May 5, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 5667  / 2 Years ago, wed, october 19, 2022, 6:07:46

I was tired of my system's name so i decided to change it.
I gksudo gedit /etc/hostname and changed my first and never touched computer name to a new one.
Then now when i sudo something like sudo gedit my terminal prompts ~: unable to resolve host <my_new host_name_i_gksudo>.



When i sudo cat /etc/hosts it gives me:



sudo: unable to resolve host <not_of_your_business!>
127.0.0.1 localhost
127.0.1.1 leviathan

# 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


How could i get rid of this problem?
Thanks in advance.


More From » command-line

 Answers
7

Have you defined your new hostname in your /etc/hosts file?



When changing your hostname, you need to alter it in both the /etc/hostname and /etc/hosts files. And once you've done that, either reboot or restart the hostname service:



sudo service hostname restart

[#27095] Friday, October 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rontablis

Total Points: 293
Total Questions: 123
Total Answers: 104

Location: Austria
Member since Mon, Mar 1, 2021
3 Years ago
;