void Get <T>(long recordID) where T : DnsResourceRecord { T record = this.GetRecord(recordID).Deserialize <T>(); m_printer.Print(record); }
public void DnsResolve(string[] args) { string domain = args.GetRequiredValue(0); DnsStandard.RecordType recordType = args.GetOptionalEnum <DnsStandard.RecordType>(1, DnsStandard.RecordType.ANAME); try { using (DnsClient client = CreateClient()) { client.UseUDPFirst = (recordType != DnsStandard.RecordType.CERT); DnsResponse response = client.Resolve(new DnsRequest(recordType, domain)); if (response == null) { Console.WriteLine("No matches"); return; } m_recordPrinter.Print(response); } } catch (DnsServerException ex) { Console.WriteLine(ex.ResponseCode); } }
string Summarize(string type, DnsResponse response) { using (StringWriter writer = new StringWriter()) { writer.WriteLine(); writer.Write(type); writer.WriteLine(" Response"); DnsRecordPrinter printer = new DnsRecordPrinter(writer); printer.Print(response); return(writer.ToString()); } }
string Summarize(string type, DnsResponse response) { using(StringWriter writer = new StringWriter()) { writer.WriteLine(); writer.Write(type); writer.WriteLine(" Response"); DnsRecordPrinter printer = new DnsRecordPrinter(writer); printer.Print(response); return writer.ToString(); } }