Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Oct 2010 16:24:06 -0400 (EDT)
From:      Chris Hill <chris@monochrome.org>
To:        Tim Kellers <timothyk@wallnet.com>
Cc:        Tim Dunphy <bluethundr@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: hostname
Message-ID:  <alpine.BSF.2.00.1010301619080.22772@tripel.monochrome.org>
In-Reply-To: <4CCC7B90.6090807@wallnet.com>
References:  <AANLkTi=LzD4iehPf7EV_PGfFFdQujMEi0BAzxp%2BVozro@mail.gmail.com> <4CCC7B90.6090807@wallnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 30 Oct 2010, Tim Kellers wrote:

> On 10/30/10 4:00 PM, Tim Dunphy wrote:
>> how can I set the hostname so that it persists through reboots? I have
>> set the hostname I want in /etc/hosts but rebooting the change does
>> not show up. In CentOS you have /etc/hostname which serves this
>> purpose but in FreeBSD I don't know how to do this.
>> 
>> 
>> thanks
>> 
> edit /etc/rc.conf and enter:
>
> hostname="[put your hostname here]"
>
> change the [put your hostname here] to your actual hostname.
>
> And it will load the name on (re)boot.

If you don't want to wait for reboot, you can set it immediately by typing

   hostname putyourhostnamehere

as root, substituting your desired host name for putyourhostnamehere. Also 
see `man hostname`. Note, this is *in addition to* editing rc.conf. The 
hostname command sets the hostname right now, and rc.conf makes it happen 
on each boot.

--
Chris Hill               chris@monochrome.org
**                     [ Busy Expunging <|> ]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1010301619080.22772>