Operating System - HP-UX
1820592 Members
1918 Online
109626 Solutions
New Discussion юеВ

hostname entries for multihomed server

 
SOLVED
Go to solution
Kenneth_18
Frequent Advisor

hostname entries for multihomed server

I have a live server which has three lan i/f with its own ip address and in /etc/hosts I see the following configuration:

ipadd1 servername
ipadd2 servername
ipadd3 servername

Can each ip interface have the same hostname configured in .etc/hosts although the server main ip is ipadd3 configured for hostname servername.

4 REPLIES 4
monasingh_1
Trusted Contributor
Solution

Re: hostname entries for multihomed server

you should not have same hostname for all IPs.
I think you may be okay to have common alias if all IPs are on the same subnet. If the IPs are on different subnet then you shoyuld not have any common hostname/alias. Think about the same from DNS server entries point of view.

just curious to think why you want to have same hostname for three IPs, any special need? If your goal is to get more bandwidth , then you can think of AUTO port aggreegation.



Muthukumar_5
Honored Contributor

Re: hostname entries for multihomed server

hostname resolvation are based on hosts: entry on /etc/nsswitch.conf file.

If it is,

hosts: files dns

Resolvation starts from /etc/hosts ( file ), dns ( /etc/resolv.conf )

So for your requirement you have to have hosts: files dns

You can use multi home network. Is there any specific need for that,

Any way, you can use aliases instead of FQDN with that as,

ipadd1 servername1 server
ipadd2 servername2 server
ipadd3 servername3 server

It will be resolved but the resolvation is done by top to bottom of file.

nslookup
Will give you the view.

If you aliases it will be more helpful to have official hostname for every interface. And more you can use hostname / ip-address for the connectivity too.
Easy to suggest when don't know about the problem!
Kenneth_18
Frequent Advisor

Re: hostname entries for multihomed server

I did'nt configure theserver that way. It came to my responsibility already like that. Anyway, I played with the order of the entries in the /rtc/hosts file and nslookup always return the first entry top to bottom.

Anyway, it's time to correct the configuration!
Sundar_7
Honored Contributor

Re: hostname entries for multihomed server

With DNS, you can have a servername resolving to 3 different IP addresses. By default, the client will receive the IP addresses in the round robin fashion if it has not been disabled in DNS.

But with /etc/hosts, there is no way to assign a hostname with multiple IP addresses.

if your nsswitch.conf has been configured to use /etc/hosts file, with the above entries, any gethostbyname(servername) system call will only return ipadd1.

If you have a DNS server in your environment and if you would like client connections to your server to be load balanced (or distributed in want of a better word), then you can add these three IP addresses in DNJS to point to servername and by enabling "Round robin" which is ON by default.
Learn What to do ,How to do and more importantly When to do ?