Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>getaddrinfo()</code> returns the head of list of <code>struct addrinfo</code> nodes. </p> <p>Travers this list using <code>struct addrinfo</code>'s a member <code>ai_next</code> to find the addresses of all interfaces of the machine. </p> <p>To receive anything else but wildcard addresses do <strong>not</strong> specify the <code>AI_PASSIVE</code> flag in the hints passed.</p> <hr> <p><strong>Update on the various names given to a machine and/or its interfaces' addresses:</strong></p> <ol> <li><p>The host's name ("<em>hostname</em>") as returend by <code>gethostname()</code> is an attribute to the host. It is <strong>configured on the host</strong> and not held in any external database. This host name <strong>per definition is not linked</strong> to any of the names the possible interfaces' addresses resolve to. The host name <strong>might</strong> however be <strong>configured</strong> to match the name that <strong>one</strong> of the addresses (of the interfaces of the machine) resolves to.</p></li> <li><p>There might be more then one interface provided by a machine. Each of these interfaces' address should resolves to a different name, which in turn could also all differ from the name returned by <code>gethostname()</code> (see 1. above). This applies to all types of interfaces including IPv4 and IPv6. There also it the virtual wildcard-address (<code>0.0.0.0</code>for IPv4) which allows programs to bind to and listen on <strong>all</strong> interfaces (IPv4 typed here) a machine provides. The wildcard-adresse has <strong>no</strong> name.</p></li> </ol> <p>The conclusion from 1. and 2. is: <strong>There is no name</strong> "<em>... like [returned by] gethostname() but canonical.</em>"!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload