Networking Forums

Networking Forums > Computer Networking > Linux Networking > host name

Reply
 
 
McHenry
Guest
Posts: n/a

 
      06-16-2006, 12:23 PM
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
 
 
 
 
Jeremiah DeWitt Weiner
Guest
Posts: n/a

 
      06-16-2006, 02:02 PM
McHenry <(E-Mail Removed)> 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
 
Bit Twister
Guest
Posts: n/a

 
      06-16-2006, 02:23 PM
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
 
Benway
Guest
Posts: n/a

 
      06-16-2006, 02:39 PM
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
 
hjwrongfellow@yahoo.co.uk
Guest
Posts: n/a

 
      06-17-2006, 02:12 AM

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
 
Bit Twister
Guest
Posts: n/a

 
      06-17-2006, 04:02 AM
On 16 Jun 2006 19:12:06 -0700, (E-Mail Removed) 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
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Host-To-Host Data Sharing via Modem Josh Converse Linux Networking 2 02-14-2007 06:48 PM
Host-to-host connection in wireless adhoc network? Tim Boneko Linux Networking 0 08-17-2005 05:28 PM
Linux<->Windows connection using USB host-to-host cable =?iso-8859-2?Q?Rados=B3aw?= Grzanka Linux Networking 0 04-10-2004 03:23 PM
Access to public host from private host through Linux router Santanu Chatterjee Linux Networking 5 11-14-2003 11:57 PM
Problems Networking Win98 host with a Win XP host Drew Windows Networking 2 10-01-2003 02:25 AM



1 2 3 4 5 6 7 8 9 10 11