Howto get your own WAN IP address

I found this today in one of the forums. I thought that it is quite handy. If you want to know your public IP address you can use this command in bash or other shells.

dig +short

Just add it as an alias in your .bashrc file.

alias myWANIP=’dig +short \’

[root@centos6 ~]# myWANIP

About Juergen Caris

I am 54yo, MSc(Dist) and BSc in Computer Science, German and working as a Senior Server Engineer for the NHS Lothian. I am responsible for the patient management system, called TrakCare. I am a UNIX/Linux guy, working in this sector for more than 20 years now. I am also interested in robotics, microprocessors, system monitoring, Home automation and programming.
This entry was posted in Bash, Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published.