-
Notifications
You must be signed in to change notification settings - Fork 924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ECS Automatically Added Despite Empty ecs-add-for #15232
Comments
This is expected and intentional behavior. You're hitting this code, which includes an explanation: pdns/pdns/recursordist/syncres.cc Lines 6092 to 6109 in 544037c
(Random fun fact: because of other code, the condition at line 6092 will always be true) |
Thanks, but I'm a little confused. How would I achieve the goal of not sending any ECS options to authoritative servers unless the subnet is explicitly provided in the query? I'm using dig for testing, in reality there is a DNS server sitting in front of PowerDNS that will provide dynamic ECS values based on user configuration. The value of |
You can't. |
@dwfreed hits the nail on the head. On an additional note, do not send ECS info to all the nameservers you're contacting. Some of them do not respond well to ECS containing queries and in general it reduces cache performance in the Recursor. Only send ECS to nameservers for which it is useful. So restrict I'm switching this to a discussion as it it's not a bug. |
Short description
PowerDNS Recursor 5.2.0 automatically adds EDNS Client Subnet (ECS) to all queries, even when not specified by the client, despite setting
--ecs-add-for=
to empty. ECS should only be included when explicitly provided (e.g., viadig +subnet
).Environment
Steps to reproduce
sudo pdns_recursor --config-dir=/etc/powerdns --socket-dir=/tmp --dnssec=off --trace=yes --quiet=no --use-incoming-edns-subnet=yes --ecs-add-for= --ecs-scope-zero-address=0.0.0.0 --edns-subnet-allow-list=0.0.0.0/0,::/0 --local-address=127.0.0.1
dig @127.0.0.1 -t txt o-o.myaddr.google.com
dig @127.0.0.1 -t txt o-o.myaddr.google.com +subnet=1.2.3.4/24
Expected behaviour
+subnet
, no ECS should be added to queries.+subnet=1.2.3.4/24
, ECS should be1.2.3.0/24
in the response.Actual behaviour
127.0.0.1/32
) is added automatically.Feb 27 19:57:34 [1] myaddr.google.com: Adding EDNS Client Subnet Mask 127.0.0.1/32 to query
"edns0-client-subnet 66.xxx.xxx.xxx/32"
(Google overrides127.0.0.1
to source IP of query).1.2.3.0/24
) is correctly passed through.Feb 27 19:58:21 [2] o-o.myaddr.google.com: Adding EDNS Client Subnet Mask 1.2.3.0/24 to query
"edns0-client-subnet 1.2.3.0/24"
Other information
--ecs-add-for=
,--ecs-scope-zero-address=0.0.0.0
,--ecs-add-for=!0.0.0.0/0,!::/0
—none stop automatic ECS.--dnssec=off --trace=yes --quiet=no --local-address=127.0.0.1
) prevents ECS, but adding--edns-subnet-allow-list=0.0.0.0/0,::/0
triggers it again.edns-subnet-allow-list
overrides--ecs-add-for=
, forcing ECS addition.The text was updated successfully, but these errors were encountered: