- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- what is the impact of localhost not at first line ...
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
тАО05-14-2010 07:12 AM
тАО05-14-2010 07:12 AM
could you please explain what is the impact of localhost not at first line of /etc/hosts? I've got several servers thus configured, and I've met a situation, see
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1427566
would that be relevant?
thanks a lot.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2010 07:50 AM
тАО05-14-2010 07:50 AM
Re: what is the impact of localhost not at first line of /etc/hosts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2010 08:07 AM
тАО05-14-2010 08:07 AM
SolutionYou can place the 'localhost' ('loopback') entry anywhere in '/etc/hosts' you desire. The '/etc/hosts' file is searched sequentially from the beginning by 'gethostent()' routines.
Since a virgin (initial) '/etc/hosts' file is deposited with only a 'localhost' entry (see: '/usr/newconfig/etc/hosts') it is logical that this entry occurs first.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2010 08:17 AM
тАО05-14-2010 08:17 AM
Re: what is the impact of localhost not at first line of /etc/hosts?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2010 09:22 AM
тАО05-14-2010 09:22 AM
Re: what is the impact of localhost not at first line of /etc/hosts?
I've always preferred it first, just because it's the first one listed in a new /etc/hosts file.
Unless - you had 127.0.0.1 defined as something else(lo0 for example) higher up in the file, and for some reason you needed not just localhost to be 127.0.0.1 but the reverse, you needed 127.0.0.1 to be localhost, in which case, the first assignment of 127.0.0.1 would return the name of the FIRST entry in /etc/hosts assigned to 127.0.0.1, which could be something like
127.0.0.1 lo0
...
...
stuff deleted
...
...
127.0.0.1 loopback
...
stuff deleted
...
...
127.0.0.1 localhost
if ran something on the above /etc/hosts file which need to reverse lookup 127.0.0.1, it would return lo0, not localhost.
So, I'd say make sure it is the first definition for 127.0.0.1 in the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-14-2010 09:36 AM
тАО05-14-2010 09:36 AM
Re: what is the impact of localhost not at first line of /etc/hosts?
look forward to someone who could make deeper conclusion about what I met before, or explain more about the role default gateway and nameserver play at that situation.
regards