I have a simple ping app made in C#. the only thing it does is pinging a host. when I'm running it on my local computers, it works in the way it should, but once I'm moving it to my server, it works weird: when pinging not existing host (even trying to resolve its DNS), it pings the server it is started on. more over, standard ping command acts the same way. Question: why does it resolve DNS in this way? I want to ping an actual host if that does exist, and get a message if it does not exist instead of pinging the server.

Server is running under MS win 2008, with IIS and MS DNS server installed on it. Am I getting this problem because of DNS server?

link|improve this question
This isn't really a programming question. – BNL Nov 28 '11 at 2:20
2  
It's not really a question at all. – Ward Nov 28 '11 at 2:55
No details, no code. Provide teh codez!!! – MikeyB Nov 28 '11 at 4:28
feedback

migrated from stackoverflow.com Nov 28 '11 at 2:50

This question came from our site for professional and enthusiast programmers.

closed as not a real question by Ward, ErikA, Chris S, joeqwerty, MikeyB Nov 28 '11 at 4:27

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. See the FAQ for guidance on how to improve it.

1 Answer

This is a programming problem. Your program is pinging 0.0.0.0, which the computer is correctly interpreting to mean "Any IP on the local computer". The program apparently is not checking for failed DNS resolution and is pinging away at the null address.

link|improve this answer
ok, Dns.GetHostEntry(host) returns server's IP address as a result. the second confusing thing is standard ping cmd works in the same way. – Alex D Nov 28 '11 at 8:28
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.