<?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: gethostname() returns undisered name in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083921#M46581</link>
    <description>10x John, I am going to try it soon.&lt;BR /&gt;since this is a production system, i'll post a reply next wednsday or thursday and tell you how did it go.</description>
    <pubDate>Thu, 02 Oct 2003 20:53:43 GMT</pubDate>
    <dc:creator>Amit Levin</dc:creator>
    <dc:date>2003-10-02T20:53:43Z</dc:date>
    <item>
      <title>gethostname() returns undisered name</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083916#M46576</link>
      <description>Hi all,&lt;BR /&gt;I have a machine with 2 network interfaces.&lt;BR /&gt;10.10.x.x and  10.5.x.x, when I activate the gethostname() function the return name is the name associated with the 10.5 network.&lt;BR /&gt;how can I change it to 10.10 network?&lt;BR /&gt;attached is a sample program, you can compile and run it to simulate problem.</description>
      <pubDate>Thu, 02 Oct 2003 10:03:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083916#M46576</guid>
      <dc:creator>Amit Levin</dc:creator>
      <dc:date>2003-10-02T10:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: gethostname() returns undisered name</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083917#M46577</link>
      <description>Hi Amit,&lt;BR /&gt;&lt;BR /&gt;if you do a tcpip show int, which address is listed first? That should be the one gethostname reports on.&lt;BR /&gt;&lt;BR /&gt;Greetings, Martin</description>
      <pubDate>Thu, 02 Oct 2003 11:25:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083917#M46577</guid>
      <dc:creator>Martin P.J. Zinser</dc:creator>
      <dc:date>2003-10-02T11:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: gethostname() returns undisered name</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083918#M46578</link>
      <description>Hi Martin,&lt;BR /&gt;this is the output of tcpip show int:&lt;BR /&gt;73::users:[amit] tcpip show int&lt;BR /&gt;                                                           Packets&lt;BR /&gt;Interface   IP_Addr         Network mask          Receive          Send     MTU&lt;BR /&gt;&lt;BR /&gt; IE0        10.10.14.20     255.255.0.0         171934150     191212288    1500&lt;BR /&gt; LO0        127.0.0.1       255.0.0.0            35385744      35385744    4096&lt;BR /&gt; WE0        10.5.14.33      255.255.0.0                 0           115    1500&lt;BR /&gt;what amazes me, is that the first interface listed is 10.10.14.20 that should return "cell73" in response to gethostname()</description>
      <pubDate>Thu, 02 Oct 2003 16:29:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083918#M46578</guid>
      <dc:creator>Amit Levin</dc:creator>
      <dc:date>2003-10-02T16:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: gethostname() returns undisered name</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083919#M46579</link>
      <description>Hi Amit,&lt;BR /&gt;I think the key is that the interfaces are of different type. I've checked with a three interface system of ours (also various types IE0, WE1, WF0) and found a similar behaviour than reported by you. On systems with all WEx devices my observation is that the first one is picked.&lt;BR /&gt;&lt;BR /&gt;As a pure guess: All the systems I looked at picked the alphabetically first configured IP interface to determine the hostname.&lt;BR /&gt;&lt;BR /&gt;Greetings, Martin    &lt;BR /&gt;&lt;BR /&gt;P.S. That might not be very helpful in your case since switching interfaces might not be an option.&lt;BR /&gt;&lt;BR /&gt;P.P.S. If you are really desparate you might want to redefine the tcpip$inet_hostaddr logical and see if this changes the translation. This is untested by me and might have sideeffects you do not like!</description>
      <pubDate>Thu, 02 Oct 2003 17:39:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083919#M46579</guid>
      <dc:creator>Martin P.J. Zinser</dc:creator>
      <dc:date>2003-10-02T17:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: gethostname() returns undisered name</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083920#M46580</link>
      <description>gethostname returns the "real" host name. This is the catenation of LOCAL_HOST and DOMAIN values as defined in TCPIP Services.&lt;BR /&gt;See:&lt;BR /&gt;&lt;BR /&gt;$ TCPIP SHOW CONFIGURATION COMMUNICATION&lt;BR /&gt;&lt;BR /&gt;You can change these with:&lt;BR /&gt;&lt;BR /&gt;$ TCPIP SET CONFIGURATION COMMUNICATION -&lt;BR /&gt;/LOCAL_HOST=name/DOMAIN=name&lt;BR /&gt;&lt;BR /&gt;At runtime, gethostname translates the system executive logical names TCPIP$INET_NODE and TCPIP$INET_DOMAIN. (note group, process and job values are ignored). In practice changing these logical names will change the result of gethostname, but may cause other unpredictable side effects - this is NOT recommended.&lt;BR /&gt;&lt;BR /&gt;Depending on what you're really trying to achieve, perhaps you should be using gethostbyaddr() using the 10.5 network address?&lt;BR /&gt;&lt;BR /&gt;To get more general, you could use ioctl() to find the IP addresses associated with all interfaces on the host, then gethostbyaddr() to find out all possible host names?</description>
      <pubDate>Thu, 02 Oct 2003 19:56:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083920#M46580</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2003-10-02T19:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: gethostname() returns undisered name</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083921#M46581</link>
      <description>10x John, I am going to try it soon.&lt;BR /&gt;since this is a production system, i'll post a reply next wednsday or thursday and tell you how did it go.</description>
      <pubDate>Thu, 02 Oct 2003 20:53:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/gethostname-returns-undisered-name/m-p/3083921#M46581</guid>
      <dc:creator>Amit Levin</dc:creator>
      <dc:date>2003-10-02T20:53:43Z</dc:date>
    </item>
  </channel>
</rss>

