[CentOS] 6.2 How to change hostname for each individual IP

Sun Apr 8 09:54:01 UTC 2012
Johnny Hughes <johnny at centos.org>

On 04/08/2012 03:59 AM, Jonathan Vomacka wrote:
> On 4/8/2012 3:52 AM, John R Pierce wrote:
>> On 04/08/12 12:19 AM, Jonathan Vomacka wrote:
>>> I am referring to when binding one of the IP alias to an application.
>>> For example if I take any application installed on my server and tell it
>>> to connect to another source from a specific IP alias, or listen on a
>>> specific alias, there are issues with the hostname. When an external
>>> source does a lookup, it comes with the server's hostname instead of the
>>> hostname I want to show up for that specific IP. Do you know why this
>>> happens?
>> the name of the host is constant, it doesn't change with the IP address
>> that a specific connection happens to be using.
>>
>> but, when you say, 'external source does a lookup', what /exactly/ do
>> you mean?
>>
> One example is an IRC bouncer. I configured the app to bind to a 
> particular IP to listen on and to connect to the designated IRC servers 
> with. When I connect the hostname reflects the machine hostname rather 
> then the hostname I want to come up on the IP address.
>
> Other applications seem to perform the same. Is it impossible to specify 
> hostnames for IP aliases. Perhaps hostname is the wrong terminology but 
> I figured RDNS and forward DNS would do the trick..
When you assign an IP addresss to a service, you are assigning a
LISTENING address (the IP that the service gets connections from) ... in
most cases, you are not assigning an OUTBOUND address for the service
but only an inbound address.

If you are talking about OUTBOUND connections from the machine to
another machine, then it always uses the "Default Gateway from the Main
IP" to make outbound connections ... so if you have 10 IPs on a Network
Card, it will always use the non-alias IP address to make outbound
connections by default unless you have other static routes set.

You can likely create some special route rules to change that ...
however, I personally do not know of any that work based on the
program/service being run.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20120408/881782f4/attachment-0004.sig>