關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • Linux 及 FreeBSD 修改 hostname

    Posted on December 9th, 2007 Sam Tang 1 comment

    在 Linux 及 FreeBSD 修改主機名也是同以下指令:

    hostname host.mydomain.com

    其中 host.mydomain.com 是新指定的 hostname,但為了系統下次啟動時也能自動使用新 hostname,需要作以下修改:

    Linux
    開啟 /etc/sysconfig/network (如果是 Debian 便開啟 /etc/hostname),將 hostname 一行改成新 hostname

    FreeBSD
    開啟 /etc/rc.conf,將 hostname 一行改成新 hostname


     

    One response to “Linux 及 FreeBSD 修改 hostname”

    1. sysctl -w kernel.hostname=xxxx
      把這段寫在/etc/rc.local
      這指令應該會讓系統名稱改變即時升笑

      or

      vi /etc/sysctl.conf
      kernel.hostname = xxxx

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word