본문 바로가기

리눅스

What Is My IP?(myip)

728x90

What Is My IP?

bind utilities

  • centos
yum install -y bind-utils
  • ubuntu
apt-get install -y bind9-dnsutils

Public IP Address

dig @resolver1.opendns.com myip.opendns.com +short

Private IP Address

ip route get 1.2.3.4 | awk '{ print $7 }' | egrep -v '^$'

 

728x90