Commit Graph

81 Commits

Author SHA1 Message Date
Shreyas Zare
f51bc6f869 DnsServer: Updated cache timer interval to 5 mins to remove expired records quickly. Code refactoring done. Implemented new DNS app interfaces. 2021-09-11 15:29:56 +05:30
Shreyas Zare
137c32e545 DnsServer: implemented NS revalidation options. 2021-08-21 12:15:52 +05:30
Shreyas Zare
24eba0c080 DnsServer: refactored ProcessDoHRequestAsync() to implement correct sequence for qpm rate limit check for different cases. 2021-08-15 19:38:35 +05:30
Shreyas Zare
df76122125 DnsServer: checking qpm rate limit after reading real ip address for cases when DoH is behind an reverse proxy. 2021-08-15 18:18:48 +05:30
Shreyas Zare
8a21c84cf2 DnsServer: implemented TsigKey and tsig implementation changes. Fixed minor issue in ProcessCNAMEAsync() preventing the response from having expected authority records. 2021-08-14 11:45:26 +05:30
Shreyas Zare
2ce21cc7bd DnsServer: implemented tsig support changes. Implemented tsig support for all queries. Updated query rate limiting feature to use client subnet for droping requests. Added option to limit error responses independently. Removed auto client ip blocking feature since it was not much effective. 2021-08-07 12:42:02 +05:30
Shreyas Zare
a48a60f1c0 DnsServer: implemented tsig support for zone transfer. 2021-07-31 19:02:48 +05:30
Shreyas Zare
b5c9f1054c DnsServer: set max stack count to 16 to resolve badly configured zones. Implemented IXFR support. Minor code refactoring done. 2021-07-10 13:35:23 +05:30
Shreyas Zare
dd09a9f477 DnsServer: refactored the DirectQueryAsync() method to return the ProcessQueryAsync() task directly. Minor refactoring done. 2021-06-19 14:15:52 +05:30
Shreyas Zare
20b4a32eab DnsServer: updated ProcessDoHRequestAsync() to limit request max content length to 512 bytes. 2021-06-12 13:50:46 +05:30
Shreyas Zare
3b72fa06a0 DnsServer: redirecting web browser request to /dns-query to the html info page. 2021-06-05 19:08:59 +05:30
Shreyas Zare
fd41f8de63 DnsServer: implemented enable blocking feature. 2021-05-30 16:39:54 +05:30
Shreyas Zare
71d5918bc4 DnsServer: Implemented blocking type feature with custom address support. Updated QPM limit feature with refused response client blocking feature. Minor corrections and refactoring done. 2021-05-29 13:11:34 +05:30
Shreyas Zare
8aaa9d5c96 DnsServer: implemented queries per minute limit feature. Updated ProcessZoneTransferQueryAsync() code to implemented new zone transfer options. 2021-05-23 18:05:17 +05:30
Shreyas Zare
3c15e96ec7 DnsServer: Implemented IDnsClient interface for direct querying. Implemented recursion ACL options. 2021-05-16 16:52:46 +05:30
Shreyas Zare
53fc761903 DnsServer: returning ServerFailure when ANAME record fails to resolve any address. 2021-05-09 18:38:21 +05:30
Shreyas Zare
1d838af920 minor code refactoring done. 2021-05-08 16:28:02 +05:30
Shreyas Zare
776b77a165 DnsServer: updated QueryCache() method with correct condition checks for cache response. Removed reset expiry code for stale records since it was moved to cache zone manager. 2021-05-08 16:18:34 +05:30
Shreyas Zare
eaa16f93d9 DnsServer: added missing response type tags to reflect correctly in stats. Forcing recursive resolution for delegation. Code refactoring done. 2021-04-24 13:19:29 +05:30
Shreyas Zare
8825f08e76 DnsServer: updated code for resetting expiry for stale records and moved it into QueryCache() method to allow reseting to occur when the first client's request expires to quickly serve stale for other clients even before the background recursive resolution process completed. 2021-04-17 14:22:09 +05:30
Shreyas Zare
eb1005697e DnsServer: fixed bug in ProcessBlockedQuery() caused by missing else condition check which would cause the server to return Refused response when block zone is not empty and block list zone is empty. 2021-04-11 20:43:34 +05:30
Shreyas Zare
eeac4ec5a6 DnsServer: implemented UseNxDomainForBlocking option. 2021-04-11 17:42:05 +05:30
Shreyas Zare
f5da78c579 DnsServer: reusing memory stream in ReadUdpRequestAsync(). Updated ProcessAPPAsync() to return server failure when app or class path is not found. Updated CachePrefetchRefreshTimerCallback() and RefreshCacheAsync() to prevent double refresh attempts. Updated CachePrefetchRefreshTimerCallback() to use threadpool tasks for better concurrency. Updated CacheMaintenanceTimerCallback() to reset due time in finally for next interval callback and using sync lock. Fixed bug in UpdateThisServer() logic. 2021-04-10 13:58:48 +05:30
Shreyas Zare
a6f839d68c DnsServer: updated cache maintenance timers to 15 mins. Updated sequence of quering for allowed and blocked zones since the old sequence was not optimal for the current state of code. Added RCODE check in RecursiveResolveAsync() before returning the response so that serve stale works when failure response is received. 2021-04-03 12:47:45 +05:30
Shreyas Zare
c79512886c DnsServer: updated ANY request handling in ProcessQueryAsync(). 2021-03-29 15:28:08 +05:30
Shreyas Zare
557df24ade DnsServer: minor optimizations done. 2021-03-27 20:16:15 +05:30
Shreyas Zare
1378845b2c DnsServer: ignoring incomplete udp requests in ReadUdpRequestAsync(). Updated ProcessANAMEAsync() to allow supporting multiple ANAME record processing for a domain concurrently. Minor code refactoring done. 2021-03-27 16:42:38 +05:30
Shreyas Zare
4b58b412f7 DnsServer: updated ProcessANAMEAsync() to resolve multiple ANAME records concurrently. Fixed ANAME resolution bug caused by checking first RR. 2021-03-21 20:45:33 +05:30
Shreyas Zare
4dc58a748a DnsServer: implemented socket async calls from .net5 in ReadUdpRequestAsync() and ProcessUdpRequestAsync(). Added missing connection close http header in DoH responses. Detecting protocol from content-type header when accept header is missing in ProcessDoHRequestAsync(). Forcing TCP for ANY queries via UDP in ProcessQueryAsync(). Passing recursion allowed flag to auth zone queries. 2021-03-21 16:48:29 +05:30
Shreyas Zare
9d8af9b383 DnsServer: Updated auto prefetch sampling implementation to correctly process CNAME records from auth zones. 2021-03-13 13:19:12 +05:30
Shreyas Zare
89ddcda5bd DnsServer: Updated code with implementation changes. Added code to stop responding to FWD and APP queries to avoid record data disclosure. Updated APP record processing. 2021-03-06 16:38:24 +05:30
Shreyas Zare
a2b4f00c0b DnsServer: fixed issue of added ttl parameter. 2021-02-27 19:43:25 +05:30
Shreyas Zare
5eddfbdda1 DnsServer: implemented app zone querying and execution logic. Added qname minimization setting. Removed feature to specify initial name servers for recursive resolution and instead providing closest name servers via ResolverDnsCache based on auth zone and cache zone. 2021-02-27 19:35:17 +05:30
Shreyas Zare
ca32ccd715 DnsServer: Updated prefetch sampling initial interval to 5 sec and refresh timer initial interval to 10 sec to allow cache auto prefetch quickly after server restarts using stored query stats data. Reimplemented prefetch sampling for eligible queries in CachePrefetchSamplingTimerCallback() to correctly handle all cases. Enabling cache prefetch and auto prefetch only when recursion is enabled. 2021-01-16 18:06:13 +05:30
Shreyas Zare
6242559c4e DnsServer: using default buffer size for tcp sockets. 2020-12-27 16:02:25 +05:30
Shreyas Zare
09fc300508 ignoring ObjectDisposedException when server stops. 2020-12-25 19:49:44 +05:30
Shreyas Zare
d50fb087fb DnsServer: made changes to handle gracefull shutdown and restarting the DNS server. 2020-12-25 18:27:04 +05:30
Shreyas Zare
32243d30e1 DnsServer: added option to control serve stale feature. 2020-12-19 12:36:58 +05:30
Shreyas Zare
d92464e3ab DnsServer: updated code to use Task instead of threads for socket request listeners for all protocols since ReceiveFrom() would not work with SendToAsync due to bug in .NET 5. This change also improves performance significantly. 2020-12-13 19:10:05 +05:30
Shreyas Zare
849df07c73 DnsServer: returning format error response when domain name is invalid. Setting recursion available flag in response for auth zone when recursion is desired since dns clients like nslookup and dig complain about it otherwise. 2020-12-12 16:40:06 +05:30
Shreyas Zare
31eee972e0 removed workaround code due to issue: https://github.com/dotnet/runtime/issues/37873 2020-12-06 18:08:41 +05:30
Shreyas Zare
bf6f92b542 minor code refactoring done. 2020-12-06 17:00:05 +05:30
Shreyas Zare
143ad95c93 DnsServer: Fixed issue in cache prefetch refresh feature that didnt take into account the Stub and Forwarder zones causing the DNS server to do usual recursive resolution to refresh cache instead of using the zone specified name servers or conditional forwarders. 2020-12-05 19:07:38 +05:30
Shreyas Zare
fdc3f2367f DnsServer: removed constructor that uses machine name as server domain. Updated ProcessCNAME() and ProcessRecursiveQueryAsync() to return additional records for NS, MX and SRV queries. 2020-10-31 13:17:36 +05:30
Shreyas Zare
09568eadc0 DnsServer: implemented RandomizeName option. 2020-10-04 20:34:19 +05:30
Shreyas Zare
e7ba3ef3b0 DnsServer: implemented DoH wwwroot feature to support certbot webroot cert renewals. Code refactoring done. 2020-09-06 16:51:08 +05:30
Shreyas Zare
a9bc0e1e7f DnsServer: removed resolver task stuck optimization. Code refactoring done. 2020-09-05 16:08:09 +05:30
Shreyas Zare
c762a4800e DnsServer: setting udp socket buffers to 64kB to improve performance. 2020-08-29 16:50:21 +05:30
Shreyas Zare
bae6b0483a DnsServer: using separate forwarder and resolver settings. Implemented async methods for request processing and for resolver. Using intependent task scheduler for resolver. Added resolver task stuck check to allow using quick stale response. 2020-08-29 14:36:00 +05:30
Shreyas Zare
f9be5c7f3d DnsServer: updated min threads count code. 2020-07-18 12:07:57 +05:30