Change hostname Centos
1 Attachment(s)
Hello
I'm using centos on lenovo x220. During installation i set up "centosx220" hostname But after installation complete i see different hostname (220-THINK). I added attachment I also see "localhost" on top of the prompt window. Help me please. |
the localhost at the top of the terminal is 100% correct. you opened a GUI konsole and you are local are you not? then yes that is correct.
to see your host name of the system, in konsole type Code:
$ hostname Code:
[user@server ~]$ hostname |
Quote:
|
Hi,
the hostname can be set by the dhcp server. What is your network setup? Evo2. |
I have soho router DRG A226G, which is also dhcp server
I looked into router settings, but i couldn't find any options to change hostname or dhcp server settings. I also tried search into router user manual, but i can't find any dhcp settings there too. http://beghiero.myftp.org/mendocino8...r%20Manual.pdf |
You can also set the hostname in /etc/sysconfig/network. Add or edit the line beginning "HOSTNAME=". See, e.g. this.
|
There is no other way ?
Whey is stored hostname typed during install proces ? |
I've used: http://www.cyberciti.biz/faq/linux-change-hostname/
some distros have set it on me too kinda like way, way back when I used winblow$ |
yeah, should like something like this:
Code:
[user@server ~]$ cat /etc/sysconfig/network |
BlackRonin: In RH variants like CentOS, hostname is set by DHCP, or in /etc/sysconfig/network. Setting it on the fly ie- '# hostname [somename]' is not permanent and won't persist across reboots.
If you are using the GUI, and NetworkManager, be sure to have the correct hostname set there, too. |
GaWdLy, i remember when i changed hostname by editting /et/sysconfig/network
Name was changed in console, but other clients in network saw old hostname, and router too. I couldn't see and ping by new hostname. So, how i can change it in DHCP ? |
Quote:
Quote:
|
GaWdLy, yes after reboot still the same in router settings:
Quote:
Quote:
"new-host 192.168.1.228" In router i have see no option to change that. |
The DHCP client sends the hostname to the server.
Try adding the directive DHCP_HOSTNAME=hostname to your /etc/sysconfig/network-scripts/ifcfg-eth0 |
https://access.redhat.com/site/docum...ng-client.html
most DHCP servers set the name, but if the DHCP server requires the name from the client, then you would use the DHCP_HOSTNAME= from michaelk's post. Quote:
|
All times are GMT -5. The time now is 08:46 PM. |