httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Korthof">
Subject Re: searching domains
Date Wed, 20 Nov 1996 19:06:45 GMT
On Nov 20, 10:29am, sameer wrote:
> Subject: Re: searching domains
> > > Bad idea: if I go to http://ibm/, and the resolver returns an address for
> > > "ibm" which is really "", the URL in the web page will still
> > > http://ibm/.
> >
> > The patch I wrote doesn't do this.  It first checks to see if "ibm" by
> 	I think Brian said my idea (resolv.conf) was the bad idea.
> > itself resolves.  It is conceivable that you have a host named "ibm" on
> > local network and you are trying to get to that.  If "ibm" does not
> > then I send a redirect back to the browser if and only if "ibm" is a
> > single word.  The redirect adds a www. to the front and a .com to the end.
> > Exactly like Netscape Navigator does.
> 	So your thing, when getting http://ibm/ on the request line, does
> 1) gethostbyname(ibm)
> 2) return a redirect for

This actually seems less preferable to me: it will probably confuse the user if
s/he types in 'http://ibn/' (for example), and is suddenly redirected to
(presumably nonexistant) ''.

The behavior I would prefer is that when the server fails to resolve the first
host, and the host is a single 'word', then the server will attempt to resolve
it by prepending 'www.' and then going through a list, and attempting to
resolve the host with '.com' appended, then '.edu', etc. -- or whichever
domains & order the administrator decides to use.  It would only return a
redirect if a host resolves -- IMO, we shouldn't be returning redirects unless
we're reasonably sure the host exists.

> 	I don't object to that, if configurable. What I object to:
> 1) gethostbyname(ibm)
> 2) gethostbyname(

If by this you mean that the server wouldn't return a redirect, but would
return data, I agree -- that would be a Bad Thing.

All of which is to say the diagram I'd like is the following:

-- gethostbyname(xyz)
  A) on success, continue as normal
  B) on failure
    1) foreach domain in domains_to_search
      a) gethostbyname(
         1) on failure, next
      b) return redirect to
    2) if no attempt succedes, return failure (unresolved address)

Ed Korthof

View raw message