in reply to getting unix users ip addresses

It's going to depend on the system that you're using. The information printed by the commands "last", "w", and "who" comes from the system's wtmp and utmp files. The specific format of these files will vary widely from one system to another, and this determines exactly what information is printed by last, who, etc.

On the systems I'm familiar with (solaris, for example), wtmp records contain the hostname but not the IP address; on solaris the hostname field is 257 characters wide, but on others it may be much smaller, causing the hostnames to be truncated as in your example.

On other systems it's certainly possible that these records contain IP addresses, in which case there's probably some "last" option to print IP addresses instead of hostnames.