Bluehost.com Web Hosting $6.95

host name

This is a discussion on host name within the Linux Networking forums, part of the Linux Forums category; Where on a Linux box does the host name get specified ? /etc/hosts or /etc/sysconfig/network If both then ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-16-2006
McHenry
 
Posts: n/a
Default host name

Where on a Linux box does the host name get specified ?

/etc/hosts

or

/etc/sysconfig/network

If both then why the double up and if not both what is the difference ?

I am using Centos.

Thanks in advance...


Reply With Quote
  #2 (permalink)  
Old 06-16-2006
Jeremiah DeWitt Weiner
 
Posts: n/a
Default Re: host name

McHenry <mchenry@mchenry.com> wrote:
> Where on a Linux box does the host name get specified ?


It depends. Different distributions put it different places, so
you'd have to look at your distribution's documentation.


> /etc/hosts
> or
> /etc/sysconfig/network
> If both then why the double up and if not both what is the difference ?


/etc/hosts is for name resolution, not telling the box what its
hostname is.


--
Oh to have a lodge in some vast wilderness. Where rumors of oppression
and deceit, of unsuccessful and successful wars may never reach me
anymore.
-- William Cowper
Reply With Quote
  #3 (permalink)  
Old 06-16-2006
Bit Twister
 
Posts: n/a
Default Re: host name

On Fri, 16 Jun 2006 20:23:40 +0800, McHenry wrote:
> Where on a Linux box does the host name get specified ?


Depends on the distribution.

> /etc/hosts
> or
> /etc/sysconfig/network
>
> If both then why the double up and if not both what is the difference ?


One is used during boot/network setup, the other for name to ip resolution.
Reply With Quote
  #4 (permalink)  
Old 06-16-2006
Benway
 
Posts: n/a
Default Re: host name

On Fri, 16 Jun 2006 20:23:40 +0800, McHenry wrote:

> Where on a Linux box does the host name get specified ?
>
> /etc/hosts
>
> or
>
> /etc/sysconfig/network
>
> If both then why the double up and if not both what is the difference ?
>
> I am using Centos.
>
> Thanks in advance...


/etc/sysconfig/network is the one you want.

HOSTNAME=myhostname.myowndomain.com
DOMAINNAME=myowndomain.com

Benway

Reply With Quote
  #5 (permalink)  
Old 06-17-2006
hjwrongfellow@yahoo.co.uk
 
Posts: n/a
Default Re: host name


McHenry wrote:

> Where on a Linux box does the host name get specified ?


$ cat /etc/hostname

$ man hostname

> /etc/hosts
>
> or
>
> /etc/sysconfig/network
>
> If both then why the double up and if not both what is the difference ?


The first one's a standard file, used by every Unix under the
sun to store the names of other computers on the network.

I don't know what the second one is. It's probably some kind
of semi-proprietary config file created by a little known distro
that nobody uses.

Reply With Quote
  #6 (permalink)  
Old 06-17-2006
Bit Twister
 
Posts: n/a
Default Re: host name

On 16 Jun 2006 19:12:06 -0700, hjwrongfellow@yahoo.co.uk wrote:
>
> I don't know what the second one is. It's probably some kind
> of semi-proprietary config file created by a little known distro
> that nobody uses.


like Redhat, Mandrake, Mandriva,...
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:37 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0