R – When retrieving URL via HttpWebRequest, can I see the IP address of the destination server

dnshttpwebrequesthttpwebresponseip address

Suppose I am retrieving a url as follows:

string url = "http://www.somesite.com/somepage.html"
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();

Is there a way I can see the IP address of the destination url?
Does it require a separate call?

Thanks

Best Answer

Look at the System.Net.Dns class. You can get a list of IP addresses of the host from the Dns.GetHostEntry() method.