Commit Graph

81 Commits

Author SHA1 Message Date
Carlo Teubner d8b1f4e7cd
Fix miscellaneous style issues (#2421)
Found by running: golangci-lint run --enable-all

I have only addressed the reported issues that seemed relevant to me.
2023-06-24 21:56:03 +02:00
Frank Denis df3fb0c9f8 Keep lines short
$ golines -w -m 120 --shorten-comments .
2022-03-23 17:48:48 +01:00
Frank Denis 3efbacc0d4 Rename 2021-03-30 11:53:59 +02:00
Frank Denis daa1f3d3b1 Add a NOT_READY return code 2021-01-03 18:09:03 +01:00
Frank Denis f245189f02 Handle captive portal names after coldstart 2021-01-01 21:39:17 +01:00
Ian Bashford 90a9a9d992
allowed ips plugin (#1510) 2020-11-15 20:59:58 +01:00
Frank Denis 4fa643ef4d Repack structures to save some memory 2020-11-14 14:46:59 +01:00
Frank Denis 272984a640 Add support for EDNS-client-subnet
Fixes #1471
2020-09-18 00:11:26 +02:00
Frank Denis fa5c55c64a Debug log query names 2020-08-09 13:09:37 +02:00
Frank Denis 03746b76bf Capitalize 2020-06-19 11:39:44 +02:00
s-s f48b13f7b8 Add DNS64 support 2020-06-08 18:42:54 +02:00
29f f71244ed74
use global 'timeout' option for forwarding queries (#1284)
* Update plugins.go

* Update plugin_forward.go
2020-04-17 20:57:23 +02:00
Kiril Angov d2602fd142
Respect proxy.mainProto in forward plugin (#1259)
* Respect proxy.mainProto in forward plugin

* Make the serverProtocol part of pluginsState instead
2020-04-05 20:49:30 +02:00
Frank Denis 19647e03a6 Overwrite the server name only when we need to send an upstream query 2020-03-13 17:52:09 +01:00
Dragonfir3 c17637c026
Don't log a server for blocked names by pattern (#1218)
* Update plugins.go

* reason update moved after reject confirmed

added boolean for direct rejects

* remove server with direct rejects

name pattern blocked cases
2020-03-13 17:50:38 +01:00
Alison Winters 1fa26eec0a gofmt whitespace 2020-02-14 18:48:48 +00:00
Frank Denis f34d7b60fa Implement serve-stale 2020-01-30 13:15:29 +01:00
Frank Denis abd221738b Explicit brackets 2019-12-23 23:17:46 +01:00
Frank Denis c27d41faa0 Avoid unneeded DNS packet unpacking 2019-12-23 11:37:45 +01:00
Frank Denis adb6dac420 Strip EDNS0 options in responses 2019-12-22 18:02:33 +01:00
Frank Denis 3fce30d7a5 Rename PluginsActionForward to PluginsActionContinue
Set the correct response code when forwarding
2019-12-17 19:19:36 +01:00
Frank Denis daf6d5881d The default return code must be PASS 2019-12-17 18:54:49 +01:00
Frank Denis b1c08f8931 Handle Drop/Synth actions the same way in query and response plugins 2019-12-17 16:28:12 +01:00
Frank Denis 4fd54a4919 Store the normalized qName in the plugin state
We now enforce the fact that a query always include a question.
It holds true for all practical use cases of dnscrypt-proxy.

This avoids quite a lot of redundant code in plugins, and is faster.
2019-12-17 10:11:41 +01:00
Frank Denis 66799c4159 Add the ability to block undelegated DNS zones
Using the generic pattern matcher as a first iteration, but we can
save some memory and CPU cycles by building and using a critbit tree
directly.
2019-12-16 16:18:47 +01:00
Frank Denis a635e92606 Add a new plugin to block unqualified host names 2019-12-09 20:25:38 +01:00
Frank Denis 67c7254dc5 block_name plugin: also check names found in CNAME records 2019-11-24 10:18:46 +01:00
Frank Denis 41e35bd8c5 Compress responses 2019-11-18 01:13:18 +01:00
Frank Denis 8728361e89 Replace SERVER_ERROR with SERVFAIL
If only because SERVFAIL can be looked up on Google
2019-11-17 22:20:47 +01:00
Frank Denis 06c0fbb65b Add NETWORK_ERROR 2019-11-17 19:48:15 +01:00
Alison Winters 97e4c44223 remove err return values that are never set 2019-11-01 17:13:14 +01:00
Frank Denis a26b2b42f0 Rename negTTL to rejectTTL to avoid confusion with cacheNegTTL 2019-10-21 18:26:49 +02:00
Markus Linnala bb01595320 feature: Add neg_ttl for rejected entries and cloak_ttl for cloaking-rules
entries

Previously cache_min_ttl was used. But one can certainly set
cache_min_ttl to 0, but still ensure synthetic values have ttl.
Hence new config file options.
2019-10-21 18:12:49 +02:00
Markus Linnala 659ff4b19d cleanup: plugins: rename error variable as err
Follow go naming tradition.
2019-10-20 21:30:24 +02:00
Alison Winters ac6fd3db39 differentiate between timeout and other error for dnscrypt servers 2019-10-19 10:36:26 +02:00
Markus Linnala acb4bbd002 fix: plugins: use deferred lock to catch all branches 2019-10-18 20:24:11 +02:00
Markus Linnala 5bf5fe6c1d cleanup: main: simplify proxy handling 2019-10-18 20:24:11 +02:00
Frank Denis 63e6dbdac7 Avoid strings.ReplaceAll() that was introduced too recently 2019-10-12 22:22:28 +02:00
Frank Denis ed0dbc2b55 Code completion propagates typos :) 2019-10-12 22:18:10 +02:00
Frank Denis d627a4bc58 Limit the number of required retries for local queries 2019-10-12 21:15:39 +02:00
Frank Denis 776e0d7ccc New feature: query_meta 2019-09-07 16:19:47 +02:00
Frank Denis 207d3172a7 Add a new "firefox" plugin to work around Firefox evil plan 2019-09-07 11:00:18 +02:00
James Newell d3ab899f7b blocked_query_response takes the format 'a:<IPv4>,aaaa:<IPv6>' for IP responses 2019-07-17 12:12:28 +02:00
James Newell 5812cb2fe4 fold 'refused_code_in_responses' and 'respond_with_ip' options into a new option 'blocked_query_response' 2019-07-17 12:12:28 +02:00
James Newell 87bbfbfc10 add new option: 'respond_with_ip' 2019-07-17 12:12:28 +02:00
Frank Denis aca031c2ec Don't display sorted latencies if there is only one (or none) 2019-06-03 18:51:21 +02:00
Frank Denis 30f2a4fd6b Misc fixes
- Set LBEstimator to true by default
- Shuffle the servers list at startup
- Add the server name to the query log
2019-06-03 16:49:06 +02:00
Ferdinand Holzer 14b464e56d Log whether response was served from cache 2019-05-28 23:14:28 +02:00
Ferdinand Holzer af096f8488 Remove request forwarding measurement from log 2019-05-28 23:14:28 +02:00
Ferdinand Holzer eab77ff871 Enhance logging (#834)
* Enhance query logging

Add request duration, and forward duration if applicable.

* Also measure requests forwarded based on forwarding_rules
2019-05-26 21:16:47 +02:00