Subject: Re: long hostnames in utmp
To: Assar <>
From: Charles M. Hannum <>
List: current-users
Date: 04/07/1996 23:35:24
Assar <> writes:

> Andrew Wheadon writes:
>  > When I take a look at last I usually find that more than
>  > 62% of the machines logging into my machine have hostnames
>  > that are longer than 16 charaters. How about increasing the
>  > length to 32 or 64 or whatever:
> That does not solve the problem.  The hostname can be of any length.
> Either make the field variable-length or (my preference) just log the
> IP-address and let last/who/whatever do the reverse mapping.

The current algorithm used by telnetd is:

* If the host name is more than 16 characters, store the IP address.
* Otherwise, store the host name.

I think the only program that maps the IP addresses currently is w(1),
but other programs could easily be modified.

BTW, if you're going to store the name, then you should at least do a
forward lookup of it to make sure it matches the IP address.