![]() flags: qr rd ra QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0 ![]() >HEADER<<- opcode: QUERY, status: NOERROR, id: 53737 The results returned look like: > Dig.Net 0.0.1 > A The output goes straight to the console but you could modify to parse the results into return values.Īdding a reference to the project I was able to do this: Dig dig = new Dig() ĭig.DnsResolver = new Resolver("8.8.8.8") If you want to specify your own resolver then use the Dig tool I mentioned above. The above methods will query the DNS servers as specified in the computer's own network settings. ![]() IPAddress GetHostAddresses(string hostNameOrAddress) IPHostEntry GetHostEntry(string hostNameOrAddress) There's a couple of static methods you could use: NET's built in capabilities you can use the System.Net namespace and the Dns class. There's plenty of free DNS services such as Google or OpenDNS you can use as nameservers. I've used this one in the past and it works pretty well. However there are a one or two dig type C# implementations such as: You don't say exactly what you want to be able to do.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |