<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Host file localhost entry location in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520137#M889481</link>
    <description>myself, i agree with melvyn, put it first.  call me superstitious, but I always put it first and I've never had any problems.&lt;BR /&gt;&lt;BR /&gt;As a suggestion, to make your maintanence easier I'd also put important hosts at the begining.  Such as, DNS servers, local interfaces, gateways, nfs servers, nis servers, time servers, etc.  About 90% of the entries in the hosts file I usual don't care about, and the 10% that are important to me I want to see right away at the top.</description>
    <pubDate>Thu, 26 Apr 2001 13:49:28 GMT</pubDate>
    <dc:creator>Curtis Larson</dc:creator>
    <dc:date>2001-04-26T13:49:28Z</dc:date>
    <item>
      <title>Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520130#M889474</link>
      <description>I need to do a sort on the hosts file to keep it in order after automatically adding entries to the bottom of the file.&lt;BR /&gt;&lt;BR /&gt;I happen to have several 10.x.x.x entries in the file and as such, the 127.0.0.1 entry gets put in numeric order with the rest of the entries.  This puts the localhost entry 5th on the list.  I have heard that the entry must be the first on the list.&lt;BR /&gt;&lt;BR /&gt;Is this true and if so what impact would it have to place the entry elseware in the file.&lt;BR /&gt;&lt;BR /&gt;Does anyone have any examples of host file sort scripts that may be better for me to use instead of just "sort hosts -o hosts.out".&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Craig A. Sharp&lt;BR /&gt;Roush Industries</description>
      <pubDate>Mon, 23 Apr 2001 12:39:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520130#M889474</guid>
      <dc:creator>Craig A. Sharp</dc:creator>
      <dc:date>2001-04-23T12:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520131#M889475</link>
      <description>I do not think that the localhost entry is required to be the mandatory first entry in the hosts file, but from experience I have seen some strange effects when it is NOT the first entry, from STM not working correctly to problems in ServiceGuard.&lt;BR /&gt;&lt;BR /&gt;I always prefer to have it as the first entry by default, but that is again my own preference/experience.</description>
      <pubDate>Mon, 23 Apr 2001 12:51:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520131#M889475</guid>
      <dc:creator>melvyn burnard</dc:creator>
      <dc:date>2001-04-23T12:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520132#M889476</link>
      <description>Hi Craig:&lt;BR /&gt;&lt;BR /&gt;I agree with Melvyn insofar as there is no reason I know that requires the 'localhost' entry to be the first one.&lt;BR /&gt;&lt;BR /&gt;I have very limited entries beyond it and the local server's hostname since use DNS services.&lt;BR /&gt;&lt;BR /&gt;In an MC/ServiceGuard cluster I have, the 'localhost' entry is actually the fifth one without problems.&lt;BR /&gt;&lt;BR /&gt;If you wanted to sort your /etc/hosts, you could extract the non-commentary, sort it and reinsert it:&lt;BR /&gt;&lt;BR /&gt;#  awk '$1 ~/[0-9]/ {print$0}' /etc/hosts|sort &amp;gt; /tmp/hosts&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;...JRF... &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Apr 2001 13:02:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520132#M889476</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-04-23T13:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520133#M889477</link>
      <description>Yes, i prefer to put localhost on the first uncommect lien followed by  hostname ip and name.&lt;BR /&gt;&lt;BR /&gt;I supose i were make a script using awk .&lt;BR /&gt;&lt;BR /&gt;awk ' NR &amp;lt; 5 { print $0 }' /etc/hosts &amp;gt; /tmp/1&lt;BR /&gt;awk ' NR &amp;gt;5 { print $0 } ' &amp;gt; /tmp/2&lt;BR /&gt;sort /tmp/2 &amp;gt; /tmp/3&lt;BR /&gt;cat /tmp/1 &amp;gt; /etc/hosts&lt;BR /&gt;cat /tmp/3 &amp;gt;&amp;gt; /etc/hosts&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Apr 2001 13:13:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520133#M889477</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-04-23T13:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520134#M889478</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;Thanks for the fast answers.  I am starting to work in a script to do what I need.  I am planning to keep the initial commented lines that hp provides and then sort and append the sorted file to the new file. I will post the script to the forum.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.&lt;BR /&gt;&lt;BR /&gt;Craig</description>
      <pubDate>Mon, 23 Apr 2001 13:21:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520134#M889478</guid>
      <dc:creator>Craig A. Sharp</dc:creator>
      <dc:date>2001-04-23T13:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520135#M889479</link>
      <description>There is a recommended method for creating a hosts file, which does not match anything I have seen here.  These methods are mainly for backward compatibility with SunOS 2,3,4, AIX 3&amp;amp;4, and SCO UNIX.  Some other OS' could care less!  Wish I could remember where the reference was, but it was in Sun documentation!&lt;BR /&gt;&lt;BR /&gt;#comments&lt;BR /&gt;1.1.1.1 dns.server.name&lt;BR /&gt;1.1.1.2 hostname.of.lan0&lt;ETH0&gt;&lt;BR /&gt;127.0.0.1 localhost&lt;BR /&gt;# all others&lt;BR /&gt;&lt;BR /&gt;I work with many systems, and have never had a problem using these criteria!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon&lt;/ETH0&gt;</description>
      <pubDate>Wed, 25 Apr 2001 22:31:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520135#M889479</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2001-04-25T22:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520136#M889480</link>
      <description>Forgot to mention that if there is no dns server, then just omit that line!&lt;BR /&gt;&lt;BR /&gt;Sorry,&lt;BR /&gt;Shannon</description>
      <pubDate>Wed, 25 Apr 2001 22:34:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520136#M889480</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2001-04-25T22:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520137#M889481</link>
      <description>myself, i agree with melvyn, put it first.  call me superstitious, but I always put it first and I've never had any problems.&lt;BR /&gt;&lt;BR /&gt;As a suggestion, to make your maintanence easier I'd also put important hosts at the begining.  Such as, DNS servers, local interfaces, gateways, nfs servers, nis servers, time servers, etc.  About 90% of the entries in the hosts file I usual don't care about, and the 10% that are important to me I want to see right away at the top.</description>
      <pubDate>Thu, 26 Apr 2001 13:49:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520137#M889481</guid>
      <dc:creator>Curtis Larson</dc:creator>
      <dc:date>2001-04-26T13:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Host file localhost entry location</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520138#M889482</link>
      <description>Thanks to all for your replies.  I have decided to use the awk method to sort the hosts file and leave the localhost entry at the beginning.&lt;BR /&gt;So far following the sort, all is well.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Craig</description>
      <pubDate>Wed, 09 May 2001 10:34:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/host-file-localhost-entry-location/m-p/2520138#M889482</guid>
      <dc:creator>Craig A. Sharp</dc:creator>
      <dc:date>2001-05-09T10:34:38Z</dc:date>
    </item>
  </channel>
</rss>

