Quote:
Originally Posted by jlinkels
What I do after cloning a machine (and thus in need of changing the hostname) is this:
Open a terminal window, su to root.
Go to /etc
Issue: grep <current_hostname> *
That should return 3 or 4 files
For each file you found issue:
sed -i s/<current_hostname>/<new_hostname>/g <filename>
Reboot
Remember that the '<' and '>' characters are quotes around names which you have to provide. Don't type them around those names!
jlinkels
|
Hi
I did not succeed in doing what you said because the output was:
-syntax error...
-there is no such file..
i myself found 2 related files in etc filder:
#file with the name as : "hostname" which was localhost.localdomain
#file with the name as : "hosts"
#generated by drakhost
#127.0.0.1 mldl.localdomain localhost
i do not understand how to do this:
For each file you found issue:
sed -i s/<current_hostname>/<new_hostname>/g <filename>
what do you mean by : "issue for each found file" ?
I also want to explain that the reason for changing host name is not the same as yours but just because i think the "localhost" is the default name so i wanted to set an specific name for my PC to not to have a default name which is the same in all other computers which use the default name
Regards