Beispiel #1
0
        public DNS()
        {
            while (true)
            {
                message = Receive();
                var    query    = new DnsQuery(message).GetBytes();
                var    hostname = new DnsQuery(query).GetName();
                byte[] responsePacket;

                Console.WriteLine(hostname);
                if (ItContains(hostname))
                {
                    responsePacket = query.Concat(answerBytes).ToArray();
                }
                else
                {
                    responsePacket = SendRequestToAnotherServer();
                }

                Send(responsePacket);
            }
        }