Ex : I want something like abc.hyd.mycompany.com. My requirement is to parse this name and initialize appropriate service.
using System.Net; Dns.GetHostName() // doesn't return fully qualified name it just gives 'abc'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You may be able to get the whole DNS string like this:
We don’t have full fledged DNS names where I work, but it does give me a three level faux domain name instead of just the hostname.
Edit 2011/03/17: Incorporated changes suggested by mark below.