I can run the command last (and last -i) in a fraction of a second, but when I run last -d, according to my tests, it takes a whopping 5 minutes and 22 seconds.
Just for reference, this is what adding the -d flag does:
-d For non-local logins, Linux stores not only the host name of the remote host but its IP number as well. This option translates the IP number back into a hostname.
There is no indication in the man pages that it should take that much extra amount of time. As it says, Linux stores the IP already, so it shouldn't have to do any sort of slow reverse-lookup of the IP based on the hostname on the spot. In addition, it is slow even when it is "looking up" that the hostname value of :0 (a local login) should return the "IP address" value of 0.0.0.0.
Is the -d flag slow on all computers, or just mine? Could this indicate a corrupted file somewhere which may be inaccessible or difficult to read?
For reference, I am running 32-bit Ubuntu 13.10 (haven't upgraded yet).