Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

why dns.gethotentry() method return addresslist as empty?

$
0
0

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.


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>