Apr 1, 2013 at 10:20 AM
Edited Apr 1, 2013 at 10:48 AM
I am building some kind of forwarding DNS server using your library.
Thanks for the great library.
It was working fine on Windows 7.
But not working on Windows 8.
So I tried your simple forwarding DNS server example.
It was working fine.
But when I tried to use a custom DNSClient it's not working again.
Seems like sending query is fine but not getting an answer.
This is the code.
static DnsClient resolver = null;
static void Main(string args)
resolver = new DnsClient(IPAddress.Parse("220.127.116.11"), 6);
using (DnsServer server = new DnsServer(IPAddress.Any, 10, 10, ProcessQuery))
Console.WriteLine("Press any key to stop server");
static DnsMessageBase ProcessQuery(DnsMessageBase message, IPAddress clientAddress, ProtocolType protocol)
message.IsQuery = false;
DnsMessage query = message as DnsMessage;
if ((query != null) && (query.Questions.Count == 1))
// send query to upstream server
DnsQuestion question = query.Questions;
DnsMessage answer = resolver.Resolve(question.Name, question.RecordType, question.RecordClass);
// if got an answer, copy it to the message sent to the client
if (answer != null)
foreach (DnsRecordBase record in (answer.AnswerRecords))
foreach (DnsRecordBase record in (answer.AdditionalRecords))
query.ReturnCode = ReturnCode.NoError;
// Not a valid query or upstream server did not answer correct
message.ReturnCode = ReturnCode.ServerFailure;
Did I make any mistake?
Or is there any problem with Windows 8?