SUMMARY:last

From: Mr Rene Occelli (rene@iusti.univ-mrs.fr)
Date: Mon Oct 21 1996 - 02:48:23 CDT


Hi,

--------------------------------
I) THE PROBLEM :
  I have a problem with the last command output. Sometimes the name of
  the host is truncated. Exemple :

mge ttyp1 lancelot.diepa.u Fri Sep 27 04:06 - 04:15 (00:08)
mge ttyp1 mhaed.production Sun Oct 20 14:47 - 14:48 (00:01)

lancelot.diepa.u for lancelot.diepa.unipa.it
mhaed.production for mhaed.production.compuserve.com

I've seen in <lastlog.h> that 16 characters was allowed to the hostname :
 struct lastlog {
         time_t ll_time;
         char ll_line[8];
         char ll_host[16]; /* same as in utmp */
 };
 
a) How can I find the complete hostname NOW ?
b) When the hostname is not truncated, how can I find WHO manages the hosts.
 I've send messages to root@hostname but have not received any responses.

I've got only one answer from : Mark Bergman <bergman@phri.nyu.edu>.
He send me a complete example on how to find hostname and who manage it

II) ANSWERS

a) The hostname is TRUNCATED in the last command. With tools like tcp_wrappers
 and log_daemon, you can have a complete log info in a file ( /var/adm/messages
by default). You have to modify the /etc/syslog.conf file to enable log
messages (assume that you have enough place).
 See a previous summary on login.

If you have no other logging informations, you can find the complete hostname
with tools on the web (in some case you can receive a million of responses ...)

b) Who manages the hosts ?

  - nslookup hostname (get IPaddress)
  - whois hostname
  -finger root@hostname (to find if it's a unix machine with a root account)

Connect to your SMTP port, attempt to expand likely aliases for
staff, hostmaster, postmaster, root.

  - telnet hostname 25 and try expn root, expn postmaster, expn staff

Use the dig command to do a reverse lookup on your IP number,
attempting to get info. about your name servers. Frequently,
individual workstations won't have "whois" listings, or reliable
administrative contacts (or the "workstation owner" is the
trouble-maker we're trying to contact someone about). The manager of
the "upstream" nameserver is likely to have authority over the
workstation--and it's owner.

   dig -x IPaddress

and redo with the usptream nameserver ....

An interactive dig program can be found on the web at:

http://sh1.ro.com/~mprevost/netutils/netutils.html (Mike-s Net Utils)

  In conclusion, finding who manage the host or the upstream server is not
trivial, and in some cases I've got no useful informations.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Rene OCCELLI +
+ I.U.S.T.I. C.N.R.S. U.M.R. 139 +
+ Av. Esc. Normandie Niemen +
+ 13397 MARSEILLE Cedex 20 France +
+ Tel: (33)91 28 82 08 +
+ Fax: (33)91 28 82 25 +
+ Email: rene@iusti.univ-mrs.fr +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

        



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:13 CDT