Subject: misc/35254: telnet (and others?) provide false/misleading/useless error message for name resolution failure
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <arto@selonen.org>
List: netbsd-bugs
Date: 12/14/2006 07:30:00
>Number:         35254
>Category:       misc
>Synopsis:       telnet (and others?) provide false/misleading/useless error message for name resolution failure
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 14 07:30:00 +0000 2006
>Originator:     Arto Selonen
>Release:        NetBSD-current 4.99.4 from ~20061128
>Organization:
>Environment:
NetBSD blah 4.99.4 NetBSD 4.99.4 (BLAH) #3: Tue Nov 28 11:30:23 EET 2006  blah@blah:/obj/sys/arch/i386/compile/BLAH i386

>Description:
% host www.aka.fi
www.aka.fi is an alias for aka_www.aka.fi.
aka_www.aka.fi has address 193.167.96.169
www.aka.fi is an alias for aka_www.aka.fi.
www.aka.fi is an alias for aka_www.aka.fi.

% telnet www.aka.fi 80
www.aka.fi: Non-recoverable failure in name resolution
Exit 1

The latter command produces an error message which is in disagreement with the result of the first command. Obviously, www.aka.fi could be resolved to IP address 193.167.96.169, so the error message given for the failure indicates at least one of the following:

1) telnet uses different means of resolving, and that fails
2) telnet does not try hard enough and fails where others succeed
3) telnet provides a false error message
4) telnet provides a misleading error message
5) telnet provides somewhat useless error message as the user has no
   means of fixing the problem (www.aka.fi is a valid string)
6) the problem is not in name resolution
7) one can recover from the problem

I guess this comes from the underscore, which is an invalid character for a host name, but valid for DNS. I hope this is not a standards issue, so that the error message for the seemingly useless failure could be fixed to provide more useful and correct information. If the problem is indeed the underscore, then the error message could read eg.

"While resolving www.aka.fi, an invalid character was observed in aka_www.aka.fi; no further attempts will be made"

Since that would lead a more educated user to try host(1) or something similar, and then succeed, the user would still be left in bewilderment as to why telnet(1) can't do what host(1) can. But at least the user would then know what is wrong, even if host name requirements were not known to the user. And, the user would then have the option of trying the IP address instead of the original name, and in some cases that would be sufficient.

Proper error messages make it possible to recover from non-recoverable failures!
>How-To-Repeat:
At the moment, aka.fi still has the above entry, so simply repeating the commands given above should be enough. If the problem comes from the underscore, then one could produce similar DNS entries (as provided in the full description) and then use those names.

If aka.fi is fixed, and the problem is not related to underscore in host name, then I don't know any other ways to produce the problem, yet.
>Fix:
Change/update/augment the error message produced by telnet(1) in the above situation to a useful/correct one.