C#/.NET: FInd out whether a server exists, Query DNS for SVC records.

Posted by TomTom on Stack Overflow See other posts from Stack Overflow or by TomTom
Published on 2010-04-15T15:40:12Z Indexed on 2010/04/19 15:13 UTC
Read the original article Hit count: 206

Filed under:
|
|

Writing a cleint/Server tool I am tasked trying to find a server to connect to. I would love to make things as easy as possible for the user. As such, my idea is to:

  • CHeck whether specific servers (coded by name) exist (like "mail.xxx" for a mail server, for example - my exampüle is not a mail server;)
  • Query otherwise for DNS SVC records, allowing the admin to configure a server location for a specific serivce (that the client connects to).

The result is that the user may have to enter only a domain name, possibly even not even that (using the registered standard domain of the computer in a LAN environment).

Anyone ideas how:

  • To find out whether a server exists and answers (i.e. is online) in the fastest way? TCP can take a long time if the server is not there. A UDP style ping sounds like a good idea to me. PING itself may be unavailable.
  • Anyonw knows how to ask from withint .NET best for a SVC record in a specific (the default) domain?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET