How to Get IP Address using Host Name

You want to get the IP Address of a given host name, you can use System.Net.Dns.GetHostAddresses method that returns System.Net.IPAddress array.

System.Net.IPAddress[] IPAddresses = System.Net.Dns.GetHostAddresses("");

ListBox1.DataSource = IPAddresses;

About author

User avatar

Waqas Anwar

Founder of, Senior Consultant, Microsoft .NET and Web Technologies