Thanks a lot for your replies.
I understand a lot now after you explained it.
Here is my problem:
I have two linux boxes, each with its own IP and hostname. Now I want to
combine these two into one linux box, but still keep the two sets of IP
addresses and hostnames. For example, when I go to the web page, both
hostnames should lead me to the same linux box after the combination.
I prefer to use one NIC to listen to two IP addresses like setting eth0 and
eth0:0 to different IP address. What I have to do is to add the hostname in
the hosts file, is that right?
thanks
Richard
"Lew Pitcher" <lpitcher@sympatico.ca> wrote in message
news:1r17d.28494$tT2.1526581@news20.bellglobal.com ...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Richard TU wrote:
> > If yes, could you guys advise how to do it?
>
> Yes, a linux system can have two host names and two IP addresses. Most
already do.
>
> For hostnames, you have to determine what sort of hostname you are
interested in.
>
> - - If it is the name returned by the hostname(1) utility, then you only
get one
> name. Sorry.
> - - If it is the name used by Samba as your systemname within a workgroup
or
> domain, then again, you only get one. Sorry.
> - - However, if it is the name associated to your IP address, then you get
as
> many names as you can assign to your IP address. You can use the
/etc/hosts
> file (see hosts(5)) to assign as many names as you want to your static
IP
> addresses. You can also use your DNS server to assign the names. You
already
> have at least /one/ host name for your system: IP address 127.0.0.1 is,
by
> convention, named as "localhost" (or "localhost.localnet") by the
/etc/hosts
> file.
>
> As for IP addresses, if your system is connected to a network, then it
already
> has at least two IP addresses. Run the ifconfig(8) command, and it will
list
> each interface you have. Most interfaces will be assigned an IP address,
> including the "lo" interface (which is assigned the IP address 127.0.0.1).
You
> get as many IP addresses as you have network interfaces for. (And, btw,
each
> IP address can have a host name, assigned either through /etc/hosts or
through
> DNS; you already have the hostname of "localhost" assigned this way, for
> instance.)
>
> To get more than one working /network/ IP address, you have to have more
than
> one working network adaptor. You either install multiple NICs into your
> system, or you use Linux "logical" networking interface. This permits you
to
> have (for instance) an eth0 /and/ an eth0:0 device; two logical interfaces
> each with it's own IP address, but on one physical NIC. See the
ifconfig(8)
> manual page for details.
>
> - --
> Lew Pitcher
>
> Master Codewright & JOAT-in-training | GPG public key available on request
> Registered Linux User #112576 (http://counter.li.org/)
> Slackware - Because I know what I'm doing.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFBXKNQagVFX4UWr64RAr4NAJ9KWArmOM1lyghT8X2MeQ U5+OuTDwCfcO66
> o3PKTmGP8uevZaSFb50zn+4=
> =BR6x
> -----END PGP SIGNATURE-----