<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://spectrum.alioth.net/doc/index.php?action=history&amp;feed=atom&amp;title=Gethostbyname</id>
	<title>Gethostbyname - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://spectrum.alioth.net/doc/index.php?action=history&amp;feed=atom&amp;title=Gethostbyname"/>
	<link rel="alternate" type="text/html" href="https://spectrum.alioth.net/doc/index.php?title=Gethostbyname&amp;action=history"/>
	<updated>2026-11-11T02:14:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://spectrum.alioth.net/doc/index.php?title=Gethostbyname&amp;diff=149&amp;oldid=prev</id>
		<title>Winston: New page: &#039;&#039;&#039;gethostbyname (IXCALL 0x3E27)&#039;&#039;&#039; - get network host entry  == Synopsis ==  &#039;&#039;Assembly language&#039;&#039;      ld hl, STR_HOSTNAME     ld de, BUF_ADDRESS     ld ix, GETHOSTBYNAME     call IXCALL...</title>
		<link rel="alternate" type="text/html" href="https://spectrum.alioth.net/doc/index.php?title=Gethostbyname&amp;diff=149&amp;oldid=prev"/>
		<updated>2008-08-16T12:27:07Z</updated>

		<summary type="html">&lt;p&gt;New page: &amp;#039;&amp;#039;&amp;#039;gethostbyname (IXCALL 0x3E27)&amp;#039;&amp;#039;&amp;#039; - get network host entry  == Synopsis ==  &amp;#039;&amp;#039;Assembly language&amp;#039;&amp;#039;      ld hl, STR_HOSTNAME     ld de, BUF_ADDRESS     ld ix, GETHOSTBYNAME     call IXCALL...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;gethostbyname (IXCALL 0x3E27)&amp;#039;&amp;#039;&amp;#039; - get network host entry&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Assembly language&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    ld hl, STR_HOSTNAME&lt;br /&gt;
    ld de, BUF_ADDRESS&lt;br /&gt;
    ld ix, GETHOSTBYNAME&lt;br /&gt;
    call IXCALL&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    #include &amp;lt;netdb.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    struct hostent *gethostbyname(char *name);&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;gethostbyname()&amp;#039;&amp;#039;&amp;#039; call converts the string passed in &amp;#039;&amp;#039;name&amp;#039;&amp;#039; to an address. The parameter &amp;#039;&amp;#039;name&amp;#039;&amp;#039; may be a null-terminated hostname (such as &amp;#039;www.worldofspectrum.org&amp;#039; or a null-terminated dotted decimal string representation of an IP address. If a dotted decimal address is passed, no lookup is made, and the string is converted to a 4 byte big-endian representation of the address. If a hostname is passed, the hostname is looked up using the DNS protocol, and the resolved address is returned as a 4 byte big-endian value. With the current implementation, only one address is returned on a successful lookup.&lt;br /&gt;
&lt;br /&gt;
For the C function call, the pointer returned is to a statically allocated buffer. If the value returned needs to be preserved when a subsequent call to gethostbyname() is made, the value must be copied before the next call is made.&lt;br /&gt;
&lt;br /&gt;
For the assembly language interface, the register pair HL points to a null-terminated string containing the hostname or dotted decimal IP address, and the DE register pair points to a location in memory with at least 4 bytes free to receive the 4 byte big-endian representation of the address.&lt;br /&gt;
&lt;br /&gt;
== Return values ==&lt;br /&gt;
&lt;br /&gt;
The C interface returns a null pointer if gethostbyname() fails to resolve the address.&lt;br /&gt;
&lt;br /&gt;
The assembly language interface returns with the carry flag set on error, with the A register containing the return code.&lt;br /&gt;
&lt;br /&gt;
[[Category:Spectranet]]&lt;/div&gt;</summary>
		<author><name>Winston</name></author>
	</entry>
</feed>