Necuno
Court Jester
- Joined
- Sep 27, 2005
- Messages
- 58,567
this seems the be the shortest method (though not sure if the proper way) to get to the dns suffix for a machine
only other methods i could find was to use ipconfig /all and "read" it from there or use the network interfaces and get it via them.
any one i missed or better manner into getting the dns suffix ?
Code:
string hostname = Dns.GetHostName();
IPHostEntry hostEntry = Dns.GetHostEntry(hostname);
string dnsSuffix = hostEntry.HostName.Replace(hostname + ".", "");
only other methods i could find was to use ipconfig /all and "read" it from there or use the network interfaces and get it via them.
any one i missed or better manner into getting the dns suffix ?