Beispiel #1
0
        void Get <T>(long recordID)
            where T : DnsResourceRecord
        {
            T record = this.GetRecord(recordID).Deserialize <T>();

            m_printer.Print(record);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
 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());
     }
 }
Beispiel #4
0
 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();
     }
 }