I use the following code to get the IP address:
var ip = Dns.GetHostEntry(host); var ipaddress =ip.AddressList.FirstOrDefault(x => x.AddressFamily == AddressFamily.InterNetwork).ToString();
it return the hostname correctly. but the Addresslist is empty or does not return ipv4 address.
i can able to ping this hostname. and also it does not working, while i am giving local machine ipaddress.