[질문] wtmp의 호스트 정보는 무엇을 근거로 기록되나요?

artoss99의 이미지

레드햇 7.3에서 last 명령어를 해보니..
여러 유저들의 접속 기록들이 나오는데..
그중에 한 호스트는 nslookup에서 못 찾더라구요..
그렇다면 dns query를 통해 기록하는거 같진 않구..
/etc/hosts 에두 그런 호스트 네임은 없구..nis나 samba는 사용하지 않구..
그럼 무엇을 통해 그 호스트네임을 알아내서 기록하나요?

그리고 그 호스트의 아이피주소는 어떻게 알아낼 수 있을까요?

pynoos의 이미지

IP 는 getpeername 이라는 함수를 통해서 알수 있습니다.

IP의 Host name은

DNS의 PTR Record를 구하는 것입니다.
nslookup으로 설명하자면

$ nslookup
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
> set type=ptr
> 211.32.117.82
Server:         164.124.101.2
Address:        164.124.101.2#53

Non-authoritative answer:
82.117.32.211.in-addr.arpa      name = cafe2.daum.net.

Authoritative answers can be found from:
117.32.211.in-addr.arpa nameserver = ns.daum.net.
117.32.211.in-addr.arpa nameserver = ns2.daum.net.
ns.daum.net     internet address = 211.32.117.10
ns2.daum.net    internet address = 211.32.117.11