<?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-05-07T21:25:49Z</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: '''gethostbyname (IXCALL 0x3E27)''' - get network host entry  == Synopsis ==  ''Assembly language''      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;'''gethostbyname (IXCALL 0x3E27)''' - get network host entry&lt;br /&gt;
&lt;br /&gt;
== Synopsis ==&lt;br /&gt;
&lt;br /&gt;
''Assembly language''&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;
''C''&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 '''gethostbyname()''' call converts the string passed in ''name'' to an address. The parameter ''name'' may be a null-terminated hostname (such as 'www.worldofspectrum.org' 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>