Add "-N" option to supress reverse name lookup.

This comes in really handy when you're telneting the broken DNS server by
IP.

PR:		bin/8698
This commit is contained in:
Bill Fumerola 1998-12-14 22:40:39 +00:00
parent 3d0ea69e61
commit 60453219bd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41805
5 changed files with 12 additions and 3 deletions

View File

@ -2186,7 +2186,8 @@ tn(argc, argv)
if (temp != INADDR_NONE) {
sin.sin_addr.s_addr = temp;
sin.sin_family = AF_INET;
host = gethostbyaddr((char *)&temp, sizeof(temp), AF_INET);
if (doaddrlookup)
host = gethostbyaddr((char *)&temp, sizeof(temp), AF_INET);
if (host)
(void) strncpy(_hostname, host->h_name, sizeof(_hostname));
else

View File

@ -145,6 +145,7 @@ extern int
termdata, /* Print out terminal data flow */
#endif /* defined(unix) */
debug, /* Debug level */
doaddrlookup, /* do a reverse lookup? */
clienteof; /* Client received EOF */
extern cc_t escape; /* Escape to command mode */

View File

@ -135,7 +135,7 @@ main(argc, argv)
rlogin = (strncmp(prompt, "rlog", 4) == 0) ? '~' : _POSIX_VDISABLE;
autologin = -1;
while ((ch = getopt(argc, argv, "8EKLS:X:acde:fFk:l:n:rt:x")) != -1) {
while ((ch = getopt(argc, argv, "8EKLNS:X:acde:fFk:l:n:rt:x")) != -1) {
switch(ch) {
case '8':
eight = 3; /* binary output and input */
@ -151,6 +151,9 @@ main(argc, argv)
case 'L':
eight |= 2; /* binary output only */
break;
case 'N':
doaddrlookup = 0;
break;
case 'S':
{
#ifdef HAS_GETTOS

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)telnet.1 8.5 (Berkeley) 3/1/94
.\" $Id: telnet.1,v 1.8 1997/11/11 05:00:59 steve Exp $
.\" $Id: telnet.1,v 1.9 1997/12/27 18:58:27 steve Exp $
.\"
.Dd March 1, 1994
.Dt TELNET 1
@ -93,6 +93,9 @@ Specifies no automatic login to the remote system.
Specifies an 8-bit data path on output. This causes the
.Dv BINARY
option to be negotiated on output.
.It Fl N
Prevents IP address to name lookup when destination host is given
as an IP address.
.It Fl S Ar tos
Sets the IP type-of-service (TOS) option for the telnet
connection to the value

View File

@ -106,6 +106,7 @@ int
donebinarytoggle, /* the user has put us in binary */
dontlecho, /* do we suppress local echoing right now? */
globalmode,
doaddrlookup = 1, /* do a reverse address lookup? */
clienteof = 0;
char *prompt = 0;