                   Propagating Server's Hostname
                            Version 0.1

                          Raphael Manfredi
                    <Raphael_Manfredi@pobox.com>
                        October 26th, 2003


1. OVERVIEW

Because most ISP today offer dynamic IP to their customers, the lifetime of
Gnutella's server IP addresses is short (around 24 hours). 

This is counter-productive for the file-serving features of Gnutella, as
the queued downloads and the download mesh only record the IP addresses of
the servers.

When users have some kind of dynamic DNS setup, it is possible for them
to provide a hostname that can be looked up through the DNS to yield
the corresponding IP address.

This proposal documents what is implemented in gtk-gnutella today (26/10/2003).


2. HOSTNAME CONFIGURATION

The GUI offers an optional configuration for a hostname.  When supplied,
this hostname will be transmitted in the query hits generated by the host
and in the HTTP headers of the server's replies for downloaders to peruse.

It is NOT beeing used in the mesh entries yet.  Servent authors are encouraged
to update their code to allow hostnames to be given as alternate locations,
in X-Gnutella-Alternate-Location or in X-Alt headers.  For backward
compatibility, gtk-gnutella does not use the optionally configured hostname
in those headers and sticks to supplying the node's IP address only (as
of 26/10/2003).


3. HTTP HOSTNAME PROPAGATION

A Gnutella node serving files and knowing its hostname will tell uploaders
about it via the X-Hostname header, provided it is not firewalled:

    X-Hostname: gnutella.example.com

It is up to the uploader to interpret this header.  The header MAY not
be always present in the server's replies, even though the hostname is
known, to save bandwidth.  In particular, follow-up HTTP/1.1 replies
SHOULD NOT contain it.


4. QUERY HIT HOSTNAME PROPAGATION

A Gnutella node replying to queries, knowing its hostname and not firewalled
SHOULD include its hostname in the trailer of its query hits, using the
"HNAME" GGEP extension.

This extension is defined as:

    Name: HNAME
    Where: Query Hit (trailer)
    Status: Experimental
    Date: Sun Oct 26 15:25:36 MET 2003
    Format: <string>
    COBS-Encoding: Never
    Deflate: Maybe

The "HNAME" extension carries the hostname of the Gnutella server, for
instance "gnutella.example.com".  The payload does not include the
trailing NUL character at the end of the string.

