[CentOS] Hostname

Phil Dobbin bukowskiscat at gmail.com
Thu Oct 11 17:10:19 UTC 2012


Leon Fauster wrote:
> Am 11.10.2012 um 09:15 schrieb Phil Dobbin:
>> I recently installed CentOS 6.3 x86_64 on a Dell Poweredge 1850 (minimal
>> desktop) & after setting the hostname during the install, when bringing
>> up a terminal prompt, I'm still getting `localhost.localdomain` instead
>> of the hostname I set during install (interestingly enough both parted &
>> fdisk both show the correct hostname).
> 
> 
> What is the output of 
> 
> $ hostname -f
> 
> ?
> 
> 
> 
>> After Googling the subject somewhat, it seems to be no definitive,
>> correct way that everybody agreed upon.
>>
>> I'm away from my CentOS boxes for the morning (including the one in
>> question) but on my Fedora 17 laptop, I notice that the given hostname
>> is set in `/etc/sysconfig/network` but in `/etc/hosts`, it's
>> `localhost.localdomain` & `localhost`.
> 
> 
> in /etc/hosts
> 
> the non-local ip should have your hostname.
> the local ip should have localhost e.g.
> 
> 127.0.0.1 localhost.localdomain localhost
> 10.1.1.1 myhost.mydomain.tld
> 
> in /etc/sysconfig/network 
> 
> set you hostname corresponding with the entry in /etc/hosts
> 
> and then reboot

Thanks, Leon.

Clear, concise & worked perfectly.

Cheers,

  Phil...

-- 
currently (ab)using
CentOS 6.3, Debian Squeeze, Fedora Beefy, OS X Snow Leopard, Ubuntu Precise


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 661 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20121011/9a20ca5c/attachment.sig>


More information about the CentOS mailing list