Showing posts with label hostname. Show all posts
Showing posts with label hostname. Show all posts

Monday, December 7, 2015

Set Hostname on CentOS Read more at: https://www.vultr.com/docs/how-to-change-your-hostname-on-centos

https://www.vultr.com/docs/how-to-change-your-hostname-on-centos

Modified on: Thu, 2 Apr, 2015 at 4:13 pm EST
CentOS Linux Guides Networking

Step 1: Login to your VPS

Locate the IP address of your Vultr VPS and login as the root user.
ssh root@server

Step 2: Use the hostname utility

Change your hostname to a different name of your choosing. For example:
hostname server01

Step 3: Edit /etc/hosts

Open the /etc/hosts file with your favorite text editor. For example:
nano /etc/hosts
Change the first line and replace your old hostname with the new one. Save the file and exit the editor.

Step 4: Edit /etc/sysconfig/network

This file also contains your hostname. Open the /etc/sysconfig/network file with your favorite text editor.
Change HOSTNAME=vultr to your desired hostname. For example: HOSTNAME=server01.

Step 5: Check your hostname

Run the following command to check your new hostname:
hostname
The new hostname will be displayed in your ssh terminal.

Step 6: (Optional) Change reverse DNS

Visit https://my.vultr.com/, then navigate to your VPS. Click on the IPv4 tab. You will see an "Update" button in the "Reverse DNS" column. Click this button to update the reverse DNS address. By default it will read:
x.x.x.x.vultr.com
It is common to replace x.x.x.x.vultr.com with the DNS name of your server, which may be related to its hostname.

Cara setting Hostname pada server Centos

http://login.e-padi.com/knowledgebase/26/Cara-setting-Hostname-pada-server-Centos.html

Tutorial ini akan menjelaskan bagaimana Cara setting Hostname pada Server Centos. Tutorial ini dapat digunakan pada VPS dan Dedicated Server semua versi Centos 32bit dan 64bits.
Tutorial ini menjadikan contoh untuk perubahan hostname seperti dibawah ini:
Hostname lama: e-padi.e-padi.com
Hostname baru: e-padi2.e-padi.com
Langkah-langkah Cara setting Hostname pada Server Centos
1. Login ke server menggunakan akun ssh root
2. Cek hostname yang digunakan sekarang dengan perintah :
[root@e-padi ~]# cat /etc/hostname
e-padi.e-padi.com
atau
[root@e-padi ~]# hostname -f
e-padi.e-padi.com
3. Edit file /etc/hosts dan ganti menjadi FQDN hostname yang baru:
# nano /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.1.60 e-padi.e-padi.com e-padi
Ganti menjadi
127.0.0.1 localhost.localdomain localhost
192.168.1.60 e-padi2.e-padi.com e-padi2
4. Setting hostname tersebut agar menjadi permanent
# nano /etc/sysconfig/network
[root@e-padi ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=e-padi2.e-padi.com
GATEWAY=192.168.1.2
[root@e-padi ~]#
5. Jika semua langkah Cara setting Hostname pada Server Centos diatas sudah dilakukan, silahkan cek hostname server untuk memastikan perubahan.
[root@e-padi ~]# hostname -f
e-padi2.e-padi.com
Jika sudah muncul seperti diatas, maka perubahan hostname pada server Centos sudah berhasil. Untuk mendapatkan efeknya, silahkan lakukan reboot server Centos.
[root@e-padi ~]# reboot
Jika perubahan sudah berhasil setelah reboot, Anda akan melihat perubahan pada console, seperti dibawah ini:
[root@e-padi2 ~]#
Semoga tutorial Cara setting Hostname pada Server Centos bisa bermanfaat, dan silahkan di share jika diperlukan.

http://login.e-padi.com/knowledgebase/26/Cara-setting-Hostname-pada-server-Centos.html