Static IP and fully qualified domain names

Cordula's Web cpghost at cordula.ws
Sat Nov 22 04:12:27 PST 2003


> >My ISP was so nice to give me a domain name (pukruppa.net) and
> >assign it statically to an IP (213.146.114.24).
> >[So now everybody in the world can telnet pukruppa.net and crack
> >my private machine :-)  ]
> >
> >>From reading manuals one should think, that now I could give my
> >machines names like one.pukruppa.net, two.pukruppa.net, etc...
> >and all these would be reachable via internet - but they aren't.
> >The only one that can be accessed is pukruppa.net .
> 
> The short answer is that you only have a single IP address assigned, and 
> as you are not authoritative for DNS records for pukruppa.net, you are 
> unable to 'subdivide' or use any more IP addresses, which would be 
> required to add additional hostnames.

Of course, you can have the DNS admins add more host names,
but all host names would point to the same IP.

Now assume that an IP packet arrives at your host. The server
that gets this IP packet cannot determine which host name was
used. All it sees is your IP address, which is always the same.

However, a protocol that runs on top of TCP could have the
client add the host name that is required. A good example
of this is HTTP/1.1, which includes a "Host: " header.

Let's assume that a web browser selects
  http://one.pukruppa.net/
  http://two.pukruppa.net/
  [...]
and you have a web server running on your host,
which is configured with these VirtualHosts.

The web server will receive packets destined to your single
IP (213.146.114.24), but it still can switch to the
correct VirtualHost section by examining the 'Host: '
header of the HTTP protocol.

Unfortunately, very few protocols that run on top of TCP
support this. Don't expect FTP, Telnet, SSH etc... to
behave differently, depending on the host name. They just
don't see it, only the (always identical) IP address.

-- 
Cordula's Web. http://www.cordula.ws/



More information about the freebsd-questions mailing list