Operating System - HP-UX
1825764 Members
2085 Online
109687 Solutions
New Discussion

Re: Binding of different IP address to the same hostname

 
SOLVED
Go to solution
Kasman_1
Occasional Contributor

Binding of different IP address to the same hostname

Hi,

Can we bind two different IP addresses to the same hostname in /etc/hosts file ?

How is HP-UX is going to resolve that ?

Thanks
5 REPLIES 5
SANTOSH S. MHASKAR
Trusted Contributor
Solution

Re: Binding of different IP address to the same hostname

Hi,

U can assign 2 different IPs with same hostname
in /etc/hosts file, but HPUX will connect to the
first one from top of the file.

-Santosh
Roland Piette
Regular Advisor

Re: Binding of different IP address to the same hostname

Hi kasman,

Insert a second IP address in /etc/hosts file will not give the opportunity for other server to reach the box.

To bind another ip address on a NIC use the ifconfig command with plumbing option.

ifconfig lanx:1 ....
where lanx is your interface, :1 is use to give a secondary address.

Don't forget to adapt the config file related of your NIC card located in /etc/rc.config.d directory.

In other way, you can also use SAM.

Regards,
Roland
Kasman_1
Occasional Contributor

Re: Binding of different IP address to the same hostname

Hello,

Sorry, maybe I did not explain the scenarion clearly.

Currently I have configured two NIC with two different IP addresses.

So what I am trying to do is to have two IP addresses that refer to the same hostname in the /etc/hosts file

e.g.
172.18.128.40 NHU2CG1
172.17.11.21 NHU2CG1

Thanks.
KapilRaj
Honored Contributor

Re: Binding of different IP address to the same hostname

You should not do that. It will break a number of products that I am aware of. First one for e.g. X server.

I would give one as the hostname of the machien and another as hostname_alias1 or so.


Regds,

Kaps
Nothing is impossible
A. Clay Stephenson
Acclaimed Contributor

Re: Binding of different IP address to the same hostname

It's not possible with /etc/hosts but it is possible using DNS. In fact, round-robin hostname resolution to different IP addresses is one way to achieve a measure of load balancing. Using DNS, you could assign the same hostname to N IP addresses and they could be on the same physical host or different hosts.
If it ain't broke, I can fix that.