Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!brl-adm!adm!narten@purdue.EDU From: narten@purdue.EDU Newsgroups: comp.unix.wizards Subject: Re: problems and suggested fix for route (4.xBSD, x>=2) Message-ID: <4595@brl-adm.ARPA> Date: Sun, 22-Feb-87 16:07:32 EST Article-I.D.: brl-adm.4595 Posted: Sun Feb 22 16:07:32 1987 Date-Received: Mon, 23-Feb-87 03:47:38 EST Sender: news@brl-adm.ARPA Lines: 29 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