Monday, June 6, 2022

[SOLVED] Linux sudo is working slow after changing the hostname

Issue

I have changed my hostname in linux mint and after that my sudo works slow I mean how to change the etc/sudoers back again to work properly or there is anything else that I have to change


Solution

you probably need to edit /etc/hosts to reflect your new hostname

otherwise it tries to find info about it via DNS (and timeouts, most probably)

look for:

127.0.0.1  localhost  oldname

and change to:

127.0.0.1  localhost  newname

Of course change only the line corresponding to oldname. Above I gave an an example of a machine which isn't connected to the net...

Below I give an example of a machine which have an IP:

127.0.0.1  localhost
a.b.c.d    oldname     <-- just edit that line


Answered By - Olivier Dulac
Answer Checked By - Clifford M. (WPSolving Volunteer)