Commit Graph

22 Commits

Author SHA1 Message Date
Robert Edmonds 49000cd4f4 Forwarding plugin: Support forwarding subdomains of the root domain
This commit updates the forwarding plugin to support matching subdomains
of the root domain ("."). It looks like the forwarding plugin already
performs subdomain matches against the domains specified in the
forwarding rules files, but matches against the root domain weren't
working because of the way matches are performed by comparing the
normalized presentation format QNAME (which omits the trailing dot for
all QNAMEs except the root domain name).

Without this commit, only queries where the QNAME is exactly "."
would match a forwarding rule for the "." domain, like this (with
`offline_mode = true` and a single forwarding rule for the "." domain):

```
[2024-03-25 21:13:31]	100.100.100.100	.	NS	FORWARD	0ms	127.0.0.1:53
[2024-03-25 21:13:36]	100.100.100.100	com	NS	NOT_READY	0ms	-
```

With this commit I get the expected result:

```
[2024-03-25 21:40:07]	100.100.100.100	.	NS	FORWARD	0ms	127.0.0.1:53
[2024-03-25 21:40:09]	100.100.100.100	com	NS	FORWARD	0ms	127.0.0.1:53
```
2024-03-25 21:30:09 -04:00
Frank Denis f531c8fffb plugin_forward: parse more conventions for IPv6 addresses 2023-08-30 21:29:09 +02:00
Frank Denis cef4b041d7 Don't call "bin" what is actually text 2023-06-24 22:11:47 +02:00
Frank Denis df3fb0c9f8 Keep lines short
$ golines -w -m 120 --shorten-comments .
2022-03-23 17:48:48 +01:00
Alison Winters eda8dd5181
replace TrimFunc(s, IsSpace) with TrimSpace for ASCII optimization (#1663) 2021-04-05 11:46:57 +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
Frank Denis 527764aba7 Upper case 2020-04-05 20:50:28 +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 824fa90f94 Forwarding plugin: force set the response ID to match the query ID
Shouldn't be necessary, but just to be safe in case `dns.Exchange()`
does something unexpected.
2020-02-05 02:52:54 +01:00
Frank Denis 63d28fc9b2 Forwarding plugin: retry over TCP if a truncated response is received
dns.Exchange() doesn't do it automatically.

Fixes #1178
2020-02-05 02:44:43 +01:00
Frank Denis 349320f291 Add support for inline comments in patterns lists
Fixes #1162
2020-01-25 15:45:23 +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 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 1674bb1742 Force clear the AD bit unless the DO bit was also set 2019-12-11 09:41:16 +01:00
Frank Denis 23aa3dd57d When forwaring, log the forwarding server instead of the regular one
Fixes #928
2019-09-11 14:17:11 +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
Frank Denis 99133f53ef Skip BOMs in configuration files
Fixes #613
2018-10-15 17:56:31 +02:00
Frank Denis 9f8bce28a4 Fix forwarding of subdomains 2018-01-17 16:16:22 +01:00
Frank Denis f35357ef88 Simplify the forwarding syntax 2018-01-17 16:06:30 +01:00
Frank Denis adcdb94d99 Allow comments in the fowarding rules 2018-01-17 12:27:29 +01:00
Frank Denis 96dadc7aca Forwarding plugin 2018-01-17 09:44:03 +01:00