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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

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

Okay