Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get external IP address of a website

I have seen many methods for easily retrieving the internal IP address of a machine or website. However, I can't seem to find a good way to retrieve the external IP address.

To clarify, if I provide a URL like bitbucket.org, I want to get the external IP address of bitbucket. Is there a web service out there that can easily do this?

EDIT: Suppose, for this case, that I am on the same network as bitbucket.org.

I am filling a database with information about all the websites our company manages. We want to keep track of the info and note periodic changes, with specific data. This program will be deployed on one of the local servers on the same network as the servers that the websites are running from. I believe the only good way of retrieving the external IP address for each site is to use an external web service.

like image 357
Wesley Porter Avatar asked Dec 21 '22 06:12

Wesley Porter


1 Answers

You can use System.Net.Dns.GetHostEntry() to get IP address by the host name.

like image 88
alex Avatar answered Dec 27 '22 03:12

alex