Re: Can linux box have two host names / 2 ip addresses

From: Bill Unruh (
Date: 10/02/04

Date: 1 Oct 2004 22:59:59 GMT

James Knott <> writes:

]Richard TU wrote:

]> 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 linux box. Is this doable?

]Certainly. Just create an alias address, so both IPs work with the one box.
]Don't worry about the host name, as that box won't.

Well, actually IP addresses refer to interfaces. If that one box has only
one interface, then the remote system will get confused-- it will send a
request to IP address 1 and receive a response from IP address 2.

Names are easy. Just have both names point to the same IP address in the
DNS tables of your DNS server (AFAIK they must be on the same subnet for this to
work. Ie you cannot have and
point tothe same IP since the domain is a different subnet than If you want the same interface (ie that one ethernet card) to have
different IP address, that is I believe more difficult. You could use
proxyarp I guess to have the one machine be the proxyarp to the other IP.
But you would still have trouble on the ip of the outbound packets.