DEV Community

Anuchit Prasertsang
Anuchit Prasertsang

Posted on

เปลี่ยนชื่อ Hostname ของเครื่อง Linux

สิ่งที่ต้องทำ

  1. ตรวจสอบชื่อ Hostname ปัจจุบัน โดยใช้คำสั่ง hostname หรือ cat /etc/hostname
  2. แก้ไขไฟล์ /etc/hostname และ /etc/hosts โดยใช้คำสั่ง vim /etc/hostname เปลี่ยนชื่อ Hostname ใหม่ เช่น TiangNa
  3. แก้ไขไฟล์ /etc/hosts โดยใช้คำสั่ง vim /etc/hosts เปลี่ยนชื่อ Hostname ใหม่ที่จับคู่กับ loopback address 127.0.1.1 TiangNa
  4. รีสตาร์ทเครื่องใหม่โดยใช้คำสั่ง sudo reboot

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay