Dns.GetHostEntry throws SocketException "No such host is know"

G

Grant Schenck

Hello,

I have an client server application running at customer sites. The client
runs on Vista and XP and runs fine at a number of customers.

However, one customer is having problems with the client on their Vista PCs
(but not their XP machines.)

Specifically, when I call Dns.GetHostEntry() it throws a SocketException
with "No such host is known". This happens even through I call it with the
server's IP address as a string. I can ping the same IP address from a
command line.

Why would Dns.GetHostEntry() fail in this way on Vista?

Thanks!

Grant Schenck
 
P

Peter Duniho

[...]
Specifically, when I call Dns.GetHostEntry() it throws a SocketException
with "No such host is known". This happens even through I call it with
the
server's IP address as a string. I can ping the same IP address from a
command line.

Why would Dns.GetHostEntry() fail in this way on Vista?

I don't know for sure, but it might be related to some known issues with
the method. Please see the comments at the bottom of this doc page for
Dns.GetHostEntry():

http://msdn.microsoft.com/en-us/library/ms143998(VS.85).aspx

You may find that GetHostByName() works better for your purposes.

It's also possible there is simply something wrong with the computer
configuration, either locally or with the DNS servers being used.

In the meantime, if you feel that the machine configuration is correct and
you are still getting errors like this, you should report the behavior as
a bug, on the Connect web site (http://connect.microsoft.com/)

Pete
 
G

Grant Schenck

Hi Peter,

Wanted to thank you. It took a while to confirm but I wrote a simple test
app and had the customer run it. In their case it only seemed to affect
Vista, not XP. The server's IP was: 172.16.17.10. GetHostEntry failed with
native error 11001 in GetAddrInfo (called by GetHostEntry,
InternalGetHostByAddress.) However, when I retry with GetHostByName that
succeeds.

Regards,

Grant Schenck

Peter Duniho said:
[...]
Specifically, when I call Dns.GetHostEntry() it throws a SocketException
with "No such host is known". This happens even through I call it with
the
server's IP address as a string. I can ping the same IP address from a
command line.

Why would Dns.GetHostEntry() fail in this way on Vista?

I don't know for sure, but it might be related to some known issues with
the method. Please see the comments at the bottom of this doc page for
Dns.GetHostEntry():

http://msdn.microsoft.com/en-us/library/ms143998(VS.85).aspx

You may find that GetHostByName() works better for your purposes.

It's also possible there is simply something wrong with the computer
configuration, either locally or with the DNS servers being used.

In the meantime, if you feel that the machine configuration is correct and
you are still getting errors like this, you should report the behavior as
a bug, on the Connect web site (http://connect.microsoft.com/)

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top