- Linux и Windows: помощь админам и пользователям
- Администрируем и настраиваем Windows, Linux.
- Как изменить hostname в openSUSE и SUSE Linux
- SUSE Support
- Here When You Need Us
- Understanding YaST2 hostname settings during SLE11 installation
- Environment
- Situation
- Resolution
- Cause
- Additional Information
- Disclaimer
- How to change Hostname in openSUSE and SUSE Linux
- Change hostname in opensuse Leap
- My server:
- Suse Linux Change Hostname (computer name) without yast
- Display the current Suse Linux hostname
- Suse Linux change hostname command
- How to change the SUSE Linux server hostname without a system restart?
- A note about hostnamectl command
- How to assign a static hostname to a server running SuSe Linux using yast
- Posted by: SXI ADMIN
Linux и Windows: помощь админам и пользователям
Администрируем и настраиваем Windows, Linux.
Как изменить hostname в openSUSE и SUSE Linux
Hostname это имя вашего десктопа или лаптопа в сети. Когда вы устанавливаете систему, вы можете задать имя, или установить опцию получения хостнейма автоматически от DHCP. Но если вам хочется изменить это имя, необходимо выполните нижеописанные шаги.
В openSUSE это можно сделать в графической оболочке следующим образом.
1. Нажмите Computer — YAST
2. Введите пароль рута, если вы используете учетную запись не администратора.
3. Нажмите Network Services в левой панели и кликнте по Hostnames.
4. Выберите строку IP адреса как на скриншоте и нажмите Edit. Измените Hostname как требуется.
5. Если вам необходимо добавить новое имя хоста, тогда нажмите Add (вместо EDIT) и введите IP адрес и новое имя.
6. Нажмите Finish.
После этого изменения вступят в силу и сетевые настройки переконфигурируются. Вручную данные действия можно проделать в файле /etc/hosts с помощью предпочитаемого вами текстового редактора.
Найдите строку с именем хоста, который вы хотите поменять и поставьте нужный вам. Сохраните файл.
В Пензе открылся новый автосалон, осуществляющий продажу, ремонт и обслуживание Субару. Весь модельный ряд, качественный сервис.
В ассортименте ООО «Эврика» огромное количество самых разных сувениров. Кстати, мжно даже купить сувениры оптом.
SUSE Support
Here When You Need Us
Understanding YaST2 hostname settings during SLE11 installation
This document (7016000) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Desktop 11 (any version)
SUSE Linux Enterprise Server 11 (any version)
SUSE Manager 1.7
SUSE Manager 2.1
Situation
Resolution
Cause
Additional Information
When setting up the network details for a given machine, the admin could actually get the impression, the hostname input field to the right of the IP address and netmask is the full qualified domain name the machine is supposed to receive. In fact, the entry this setting creates is a resolve entry in /etc/hosts but not the hostname in /etc/HOSTNAME. Leaving the hostname and domain input field on the hostname/DNS tab empty will result in a setup without a FQDN. YaST2 will not complain about this and proceed if the installation but this might cause problems later once additional services need to be configured.
On SUSE Linux Enterprise 10 based products the FQDN was entered before the IP settings during the network set up.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented «AS IS» WITHOUT WARRANTY OF ANY KIND.
How to change Hostname in openSUSE and SUSE Linux
Hostname is the name of the pc or laptop or even your system with which it is identified on a network. When you did the installation, you would have not specified the hostname or is assigned by a DHCP server but you would want to change it then here is the procedure.
In openSUSE, if you would like to do this from the Desktop.
1. Click Computer – YAST
2. Enter the root user password, if you are not an administrator on the system.
3. Click Network Services in the left pane and click Hostnames.
4. Select the IP Address Hostname line as in this screenshot and click Edit. Change the Hostname as required.
5. If you need to add a new Hostname, then click Add (instead of EDIT) and enter the IP Address and new hostname.
This should change the hostname and resconfigure the Network Card. The effective change is that it change the hostname entry in the /etc/hosts file.
To manually edit the hostname without using the YAST control center then edit the /etc/hosts with your favorite Text editor
And update the following file with the new hostname
and look for the line with the hostname that you want to change and change as required. If you want to add a new hostname the in a new line enter the IP Address and the hostname. Save the file.
Also, in Network Manager, there is a setting which overwrites the hostname it has onto the /etc/hosts file. Hence, it is important to either disable the option or to enter the right hostname in here as well.
1. Click Start Menu – Computer – YaST – Network Devices – Network Settings
2. Click Hostname/DNS tab and untick “Write hostname to /etc/hosts” or alternatively, enter the appropriate hostname in the box provided as shown in the screenshot below:
This should help. The next time reboot the your system, the hostname should have changed.
Change hostname in opensuse Leap
Let me tell you how to change to the hostname in OpenSUSE Leap test machine. I was fighting the last two days before this working method, this method should work on Suse Server 12, OpenSUSE 42.x and Opensuse 15.
My server:
# uname -a
Linux suse15 4.12.14-lp150.8-default #1 SMP Sat Apr 7 05:12:52 UTC 2018 (8719fc4) x86_64 x86_64 x86_64 GNU/Linux
IP: 192.168.65.151
Hostname: suse15
Domain name: osradar.com.
The actual info:
Change hostname procedure :
The procedure to change the computer hostname on openSuse Linux:
Type the following command to edit /etc/hostname using your preferred text editor:
sudo vi /etc/hostname
Delete the existing name and put a new name.
Now Edit the /etc/hosts file:
vi /etc/hosts
Replace any name related to the existing computer name with your new one.
Reboot the system to changes take effect
sudo reboot
Using hostingctl command
hostingctl is a command from where you can change the hostname also with the following commands:
Using Yast2
Yast2 us GUI tool to manage your server/desktop
Start Yast2 with
# sudo yast2
Then NetworkServices > Hostnames > and change hostname related to your IP address
Restart rcnetwork services.
How to verify?
Please reboot for the final check and enjoy
Suse Linux Change Hostname (computer name) without yast
I am a new Suse Enterprise Linux user. I setup my computer name to ‘linux-mig6’ during installation but now I would like to change the computer name to something else. How can I remove old name and set it to ‘suse-linux-server’ on SLES version 12 SP 3? Can you tell me how do I change the Suse computer name? How do I assign a static hostname to server running SuSe Linux?
The Suse Linux hostnamectl command can be used by sysadmin to change the hostname of a SUSE Linux server/laptop/desktop. You can use the hostname command to see or set the system’s host name too. The host name or computer name is usually at system startup in /etc/hostname file. Open the terminal application and type the following command to change hostname on Suse Linux.
Display the current Suse Linux hostname
Type any one of the following command:
$ hostname
OR
$ hostnamectl
Suse Linux change hostname command
The procedure to change the computer name on Suse Linux:
- Type the following command to edit /etc/hostname using nano or vi text editor:
sudo vi /etc/hostname - Delete the old name and setup new name.
- Next Edit the /etc/hosts file:
sudo vi /etc/hosts - Replace any occurrence of the existing computer name with your new one.
- Reboot the system to changes take effect:
sudo reboot
How to change the SUSE Linux server hostname without a system restart?
Type the following commands:
$ sudo hostname new-server-name-here
Next edit the /etc/hostname file and update hostname:
$ sudo vi /etc/hostname
Finally, edit the /etc/hosts file and update the lines that reads your old-host-name:
$ sudo vi /etc/hosts
From:
127.0.1.1 old-host-name
To:
127.0.1.1 new-server-name-here
Save and close the file.
A note about hostnamectl command
Systemd based Linux distor such as SUSE Linux 12.x and above can simply use the hostnamectl command to rename hostname. To see current setting just type:
$ hostnamectl
Sample outputs:
Static hostname: linux-mig6.suse
Transient hostname: linux-mig6
Icon name: computer-vm
Chassis: vm
Machine ID: 97b5d5396d5d1b2c11c0ea965a7456fb
Boot ID: e29ed76aad154e7392fce498231c9a09
Virtualization: kvm
Operating System: SUSE Linux Enterprise Server 12 SP3
CPE OS Name: cpe:/o:suse:sles:12:sp3
Kernel: Linux 4.4.103-6.38-default
Architecture: x86-64
To change hostname from linux-mig6 to suse-nixcraft, enter:
$ sudo hostnamectl set-hostname suse-nixcraft
$ hostnamectl
How to assign a static hostname to a server running SuSe Linux using yast
yast is universal configuration utility for SuSe/OpenSuSe. To setup hostname run yast command:
$ sudo yast
OR
$ sudo yast2
You must use the TAB and arrow keys to navigate YaST. In YaST, navigate to System, then Network Settings, and then press the Enter key. Use the arrow keys to navigate to Hostname/DNS and use the TAB key and Shift + TAB key combination to set options:
Next set the hostname and domain name to preferred values. Use the TAB key to navigate to [ OK ] and press the Enter key to save changes. Finally, use the TAB key to navigate to [Quit] and press the Enter key to exit app.
Posted by: SXI ADMIN
The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.