Solved my public ip is different from my ip when ssh'ing

molofishy

Member

Reaction score: 3
Messages: 51

When I type:
curl ifconfig.me

I get my public ip (same number as when I go to https://www.whatismypublicip.com/). However, when I ssh into the various servers I have access to, and then type last -10, the ip address that always appears next to my name is:
55.152.221.203.d

What is going on? I would have expected to see my public ip? whois 55.152.221.203 (without the "d" -- not sure what the "d" is for) is some address in USA, but I am in Australia!?
 

aragats

Daemon

Reaction score: 515
Messages: 1,246

last reports hostnames, not IP addresses. I'm not sure how it exactly works, but it either comes from rDNS or is reported by your ISP: 55.152.221.203.d is a hostname.
 

Datapanic

Well-Known Member

Reaction score: 178
Messages: 370

You need to do a whois 203.221.152.55

The 55.152.221.203.d is truncated: name = 55.152.221.203.dial.dynamic.acc02-moon-tow.comindico.com.au. is what it will show you if you do an nslookup 203.221.152.55 (or the equivalent FreeBSD substitute of drill 203.221.152.55)
 

ShelLuser

Son of Beastie

Reaction score: 1,726
Messages: 3,545

When in doubt check the manualpage. From last(1):

Code:
DESCRIPTION
     The last utility will either list the sessions of specified users, ttys,
     and hosts, in reverse time order, or list the users logged in at a speci-
     fied date and time.
From my server:

Code:
peter      pts/0    win7.intranet.lan    Wed Aug  2 07:19 - 08:00  (00:41)
peter      pts/4    tmux(1906).%6          Tue Aug  1 21:33 - 21:35  (00:02)
peter      pts/4    tmux(1906).%5          Tue Aug  1 20:52 - 21:29  (00:37)
peter      pts/4    tmux(1906).%4          Tue Aug  1 20:45 - 20:47  (00:01)
peter      pts/0    win7.intranet.lan    Tue Aug  1 18:33 - 01:31  (06:58)
 
OP
OP
M

molofishy

Member

Reaction score: 3
Messages: 51

You need to do a whois 203.221.152.55

The 55.152.221.203.d is truncated: name = 55.152.221.203.dial.dynamic.acc02-moon-tow.comindico.com.au. is what it will show you if you do an nslookup 203.221.152.55 (or the equivalent FreeBSD substitute of drill 203.221.152.55)
host 203.221.152.55 seems to show 55.152.221.203.dial.dynamic.acc02-moon-tow.comindico.com.au.. Works on linux and freebsd.

Thanks!
 
Top