problems and suggested fix for route (4.xBSD, x>=2)

narten at purdue.EDU narten at purdue.EDU
Mon Feb 23 07:07:32 AEST 1987


Gethostbyname() is where the fix should be. Anyone who has used
networking software extensively knows that there are times when using
a dotted Internet address instead of a host name is useful (and
necessary!) It is extremely annoying and often tragic that the
acceptance of dotted numbers is application specific.

Predictable and uniform behavior is a desirable feature. Some programs
take dotted names, others do not. Of those that do, some call
gethostbyname first, checking whether or not the name is in dotted
notation only as a last resort. When a nameserver is involved,
gethostbyname doesn't return quickly (if at all).

The algorithm should be:

If in the Internet domain, is the host name in dotted notation? If
so, return the internet address right away. If the name is not in
dotted form, THEN do what gethostbyname currently does.

Using this algorithm lets all networking software take dotted names.
(e.g. the code resides in library routines.) Furthermore, neither the
nameserver or host table is consulted in doing translations that it
wouldn't perform anyway.

The only problem I see is that for gethostbyname to return "hostent"s
for addresses in dotted notation, a "fake" entry must be created with
some sort of bogus Official name. This will undoubtably break existing
programs in silly ways.

Thomas



More information about the Comp.unix.wizards mailing list