- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /etc/hosts file entries
Operating System - HP-UX
1753797
Members
7215
Online
108805
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2000 07:20 PM
тАО03-21-2000 07:20 PM
/etc/hosts file entries
In our environment here there is an application requirement to have multiple IP
Addresses ( of terminals ) point to a single alias name.
The typical entries would look like :
IPADDR-1 ALIAS-1 # COMMENT-1
IPADDR-2 ALIAS-2 # COMMENT-2
The alias name is picked up by a script using " who am i -R " option in the
application. It has been observed that the alias names are sometimes ( very
random ) not picked up correctly.
Any ideas as to what is the method in which who am i -R works and if I can have
such entries in /etc/hosts.
Thanks for your help.
Regards,
Ravi
Addresses ( of terminals ) point to a single alias name.
The typical entries would look like :
IPADDR-1 ALIAS-1 # COMMENT-1
IPADDR-2 ALIAS-2 # COMMENT-2
The alias name is picked up by a script using " who am i -R " option in the
application. It has been observed that the alias names are sometimes ( very
random ) not picked up correctly.
Any ideas as to what is the method in which who am i -R works and if I can have
such entries in /etc/hosts.
Thanks for your help.
Regards,
Ravi
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2000 08:29 PM
тАО03-21-2000 08:29 PM
Re: /etc/hosts file entries
Hi Ravi,
The output of who am i -R is as soon below:
username ttyp3 Mar 22 12:55 (ip address)
You can use/read the online manual for 'who' (man who) , I think that will
assist you.
The output of who am i -R is as soon below:
username ttyp3 Mar 22 12:55 (ip address)
You can use/read the online manual for 'who' (man who) , I think that will
assist you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2000 09:25 PM
тАО03-21-2000 09:25 PM
Re: /etc/hosts file entries
I have checked on the man. It says that it would do gethostbyname or
gethostbyaddr as the case may be.
Since we have multiple IP Address entries with the same alias name defined, the
command sometimes is returning a different alias name which appears to be
picked up at random.
I hope I made my problem clear. Please help.
Regards,
Ravi
gethostbyaddr as the case may be.
Since we have multiple IP Address entries with the same alias name defined, the
command sometimes is returning a different alias name which appears to be
picked up at random.
I hope I made my problem clear. Please help.
Regards,
Ravi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-21-2000 11:37 PM
тАО03-21-2000 11:37 PM
Re: /etc/hosts file entries
I found the following info which may be useful ?
According to the manual "Administering ARPA Services" page 2-10,
"Adding Remote Connectivity (Edit /etc/hosts)", If your host has more
than one IP address (for multiple network interfaces),you must addd entries for
every IP address. These entries must have the same official host name but
different aliases.
When the other machine refers to the hosts file for the hostname to IP address
resolution, only the first entry IP address is taken even though the machine is
on the second network.
For example,
Machine test2 has two network cards with IP address 15.19.65.1 and 16.19.65.1
The /etc/hosts file has the following content
15.19.65.1 test2 test2_if1
16.19.65.1 test2 test2_if2
When the client with IP address 16.19.65.2 run command telnet test2 it uses
the 15.19.65.1
Even though the book says that you must have multiple entries in /etc/hosts
with the official name first, and aliases second, this can be misleading:
Say I have a system named test with 2 interfaces:
1.2.3.4 test1 first
1.2.3.5 test1 second
If I do a gethostbyname() call, perhaps by doing a nslookup:
% nslookup test1
Name: test1
Address: 1.2.3.4
Aliases: first
So, the lookup of the official hostname will ALWAYS return the first entry from
the /etc/hosts table.
% nslookup first
Name: test1
Address: 1.2.3.4
Aliases: first
% nslookup second
Name: test1
Address: 1.2.3.5
Aliases: second
So, if a program wants to lookup an alias, it will be able to find the
canonical/official host name. This is the desirable behavior. Are you sure the
syntax in /etc/hosts is correct and is DNS involved at all in the equation ?
If you have unique /etc/hosts on each host. List the appropriate official
address first. So, on Client A's /etc/host, have the first official address of
Server A be 15.19.65.2 as in :
Client A /etc/host:
15.19.65.2 ServerA firstnic
16.19.65.2 ServerA secondnic
Client B /etc/host:
16.19.65.2 ServerA secondnic
15.19.65.2 ServerA firstnic
Then you could use the nsswitch.conf file (switch(4)) to reference /etc/hosts
first and DNS second ? may be of some help, hopefully someone with more
networking knowledge than I maybe able to confirm this or fill in any gaps ?
According to the manual "Administering ARPA Services" page 2-10,
"Adding Remote Connectivity (Edit /etc/hosts)", If your host has more
than one IP address (for multiple network interfaces),you must addd entries for
every IP address. These entries must have the same official host name but
different aliases.
When the other machine refers to the hosts file for the hostname to IP address
resolution, only the first entry IP address is taken even though the machine is
on the second network.
For example,
Machine test2 has two network cards with IP address 15.19.65.1 and 16.19.65.1
The /etc/hosts file has the following content
15.19.65.1 test2 test2_if1
16.19.65.1 test2 test2_if2
When the client with IP address 16.19.65.2 run command telnet test2 it uses
the 15.19.65.1
Even though the book says that you must have multiple entries in /etc/hosts
with the official name first, and aliases second, this can be misleading:
Say I have a system named test with 2 interfaces:
1.2.3.4 test1 first
1.2.3.5 test1 second
If I do a gethostbyname() call, perhaps by doing a nslookup:
% nslookup test1
Name: test1
Address: 1.2.3.4
Aliases: first
So, the lookup of the official hostname will ALWAYS return the first entry from
the /etc/hosts table.
% nslookup first
Name: test1
Address: 1.2.3.4
Aliases: first
% nslookup second
Name: test1
Address: 1.2.3.5
Aliases: second
So, if a program wants to lookup an alias, it will be able to find the
canonical/official host name. This is the desirable behavior. Are you sure the
syntax in /etc/hosts is correct and is DNS involved at all in the equation ?
If you have unique /etc/hosts on each host. List the appropriate official
address first. So, on Client A's /etc/host, have the first official address of
Server A be 15.19.65.2 as in :
Client A /etc/host:
15.19.65.2 ServerA firstnic
16.19.65.2 ServerA secondnic
Client B /etc/host:
16.19.65.2 ServerA secondnic
15.19.65.2 ServerA firstnic
Then you could use the nsswitch.conf file (switch(4)) to reference /etc/hosts
first and DNS second ? may be of some help, hopefully someone with more
networking knowledge than I maybe able to confirm this or fill in any gaps ?
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP