Skip to content
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

Feature Request: Custom IP for EDNS client subnet #1472

Closed
AvailCat opened this issue Mar 13, 2020 · 12 comments
Closed

Feature Request: Custom IP for EDNS client subnet #1472

AvailCat opened this issue Mar 13, 2020 · 12 comments

Comments

@AvailCat
Copy link

AvailCat commented Mar 13, 2020

(@ainar-g: updating the top post to summarize the discussion and make sure nothing is lost; original content is under the <details> tag.)

In some situations, users need the ability to set the EDNS(0) Client Subnet to a custom value.

Proposed changes:

  • UI:

    • On the Settings → DNS settings page, in the DNS-server configuration section, expand the Enable EDNS client subnet inputs:

      • Add the checkbox input Use custom IP subnet.

      • Add the text input Custom subnet, which is only active when the previously-added checkbox is checked.

    • Add the same inputs to persistent client settings.

  • Configuration file:

    • The boolean property dns.edns_client_subnet is replaced with the following new object:

      edns_client_subnet:
          enabled: true
          use_custom: true
          custom: '1.2.3.0/24'
    • The migration should preserve the old value of dns.edns_client_subnet and set it into the new dns.edns_client_subnet.enabled property. The default values for the other properties are false and empty string.

    • Add the same object to persistent clients.


Original post content

My environment:
I have following device:

  • Computer 1 (Internal A, Internal B): 192.168.1.2, 10.0.0.3
  • Server A (Internal A): 192.168.1.10 (ADGuard locate at here)
  • Server B (Internet): 10.0.0.1 (Internal DoH reverse proxy)

The target server have two options,

  • 10.0.0.3(Internal B) for 10.0.0.0/24
  • a.b.c.d(Internet) for Internet traffic

Problem:
Computer 1 should connect to target server with 10.0.0.3 for better speed, but AdGuardHome won't let DoH server know this device was also located in 10.0.0.0/24, then it will resolve target to a.b.c.d

@zero77
Copy link

zero77 commented Sep 18, 2020

@AvailCat
This should be possible with dnscrypt-proxy.

@ghost
Copy link

ghost commented Dec 7, 2020

why not start by anonymise the ip (like NextDns Do), see if it's simple or not, and decide after that ?

Edit : when i say anonymise i think let enough in ipv4 ans ipv6 for the CDN to localise the country, but not the full ip

@ainar-g
Copy link
Contributor

ainar-g commented Jan 24, 2022

A possible extension from #4187: per-client EDNS subnet settings.

@ainar-g ainar-g mentioned this issue Feb 17, 2023
3 tasks
adguard pushed a commit that referenced this issue Mar 1, 2023
Merge in DNS/adguard-home from 1472-edns-custom-ip to master

Updates #1472.

Squashed commit of the following:

commit 07460c3
Merge: 6545543 ae653f1
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 1 15:38:46 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 6545543
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 1 15:37:17 2023 +0300

    dnsforward: add todo

commit e1978ad
Merge: 6cd98f4 bb22643
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 1 11:32:23 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 6cd98f4
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 1 11:31:16 2023 +0300

    all: fix chlog; fix field alignment

commit defdec6
Merge: 1130ebd a772212
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 28 12:17:23 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 1130ebd
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 28 12:13:30 2023 +0300

    all: add use_custom field

commit ec0cdc7
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Feb 27 13:59:13 2023 +0300

    all: fix chlog; imp code

commit f8450cf
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Feb 27 11:28:16 2023 +0300

    dnsforward: fix fmt

commit 54a344e
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Feb 27 11:11:52 2023 +0300

    all: fix chlog; add test case

commit 47b5476
Merge: 8724f37 304f2ba
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Feb 22 16:33:07 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 8724f37
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Feb 22 16:31:40 2023 +0300

    all: fix comments

commit d2b1528
Merge: 7898c23 76a513c
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Feb 22 11:53:25 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 7898c23
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Feb 22 11:52:37 2023 +0300

    all: upd chlog

commit 8763261
Merge: d28394b ff9b24a
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 21 17:12:03 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit d28394b
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 21 17:11:29 2023 +0300

    home: fix default value

commit 1a5da3f
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 21 13:37:04 2023 +0300

    all: add custom ip for edns
@LittleJake
Copy link

A possible extension from #4187: per-client EDNS subnet settings.

Is there any difference that request an AAAA/A record with the subnet of IPV4/IPV6?

What if using IPV4 for the subnet of an AAAA record or using IPV6 for the subnet of an A record?

@YBS-PC
Copy link

YBS-PC commented Mar 10, 2023

v0.107.26
if edns_client_subnet.use_custom is true then AGH not starting for me (wih or without custom_ip).

@ainar-g
Copy link
Contributor

ainar-g commented Mar 10, 2023

@LittleJake, the same IP network is used. There is no connection between the type of the question and the ECS option.

@YBS-PC, please provide the verbose logs to diagnose the issue.

@YBS-PC
Copy link

YBS-PC commented Mar 10, 2023

@YBS-PC, please provide the verbose logs to diagnose the issue.
aghlog.txt

@LittleJake
Copy link

@YBS-PC, please provide the verbose logs to diagnose the issue.
aghlog.txt

Use the exact IP address just fine. AdGuardHome will mask the IP address into /24. But you can't assign the mask of the IP address is not a good idea.

heyxkhoa pushed a commit to heyxkhoa/AdGuardHome that referenced this issue Mar 20, 2023
Merge in DNS/adguard-home from 1472-edns-custom-ip to master

Updates AdguardTeam#1472.

Squashed commit of the following:

commit 07460c3
Merge: 6545543 ae653f1
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 1 15:38:46 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 6545543
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 1 15:37:17 2023 +0300

    dnsforward: add todo

commit e1978ad
Merge: 6cd98f4 bb22643
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 1 11:32:23 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 6cd98f4
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 1 11:31:16 2023 +0300

    all: fix chlog; fix field alignment

commit defdec6
Merge: 1130ebd a772212
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 28 12:17:23 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 1130ebd
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 28 12:13:30 2023 +0300

    all: add use_custom field

commit ec0cdc7
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Feb 27 13:59:13 2023 +0300

    all: fix chlog; imp code

commit f8450cf
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Feb 27 11:28:16 2023 +0300

    dnsforward: fix fmt

commit 54a344e
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Feb 27 11:11:52 2023 +0300

    all: fix chlog; add test case

commit 47b5476
Merge: 8724f37 304f2ba
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Feb 22 16:33:07 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 8724f37
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Feb 22 16:31:40 2023 +0300

    all: fix comments

commit d2b1528
Merge: 7898c23 76a513c
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Feb 22 11:53:25 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit 7898c23
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Feb 22 11:52:37 2023 +0300

    all: upd chlog

commit 8763261
Merge: d28394b ff9b24a
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 21 17:12:03 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip

commit d28394b
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 21 17:11:29 2023 +0300

    home: fix default value

commit 1a5da3f
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Feb 21 13:37:04 2023 +0300

    all: add custom ip for edns
adguard pushed a commit that referenced this issue Mar 22, 2023
Merge in DNS/adguard-home from 1472-edns-custom-ip-api to master

Updates #1472

Squashed commit of the following:

commit 7605ec5
Merge: 8b2ac22 194ead3
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Mar 22 13:39:25 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip-api

commit 8b2ac22
Merge: d5ca8b6 c3edab4
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 21 18:26:55 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip-api

commit d5ca8b6
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 21 18:26:24 2023 +0300

    dnsforward: imp tests

commit 1302586
Author: Vladislav Abdulmyanov <v.abdulmyanov@adguard.com>
Date:   Tue Mar 21 16:47:56 2023 +0200

    client: change validation for custom edns ip

commit 44e4dc6
Author: Vladislav Abdulmyanov <v.abdulmyanov@adguard.com>
Date:   Tue Mar 21 16:31:42 2023 +0200

    client: implement edns custom ip

commit 8a3e7ad
Merge: 04ac111 f736d85
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 21 15:04:40 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip-api

commit 04ac111
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 21 15:03:39 2023 +0300

    dnsforward: imp tests

commit b44f6d0
Merge: 19c6851 48431f8
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Mar 20 17:55:49 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip-api

commit 19c6851
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Mar 10 10:40:15 2023 +0300

    all: fix chlog

commit 6dcdcbd
Merge: a7f1bf7 a205352
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Mar 10 10:23:37 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip-api

commit a7f1bf7
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 7 19:24:18 2023 +0300

    home: fix default value

commit 0311a9b
Merge: 7e0bb3d 1011b8f
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 7 19:04:18 2023 +0300

    Merge branch 'master' into 1472-edns-custom-ip-api

commit 7e0bb3d
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 7 19:03:24 2023 +0300

    all: fix chlog

commit 202d7cc
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 7 11:35:41 2023 +0300

    dnsforward: fix typo

commit fe95e00
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 7 11:28:21 2023 +0300

    all: fix docs

commit 66835a9
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Tue Mar 7 10:48:08 2023 +0300

    dnsforward: add todo

commit b58255e
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Mar 6 15:40:02 2023 +0300

    all: upd chlog

commit 9b2be7f
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Mar 3 11:22:19 2023 +0300

    dnsforward: edns custom ip api
@ainar-g ainar-g modified the milestones: v0.109.0, v0.107.27 Mar 23, 2023
@ainar-g ainar-g closed this as completed Mar 23, 2023
@ainar-g ainar-g assigned schzhn and unassigned ainar-g Mar 23, 2023
@ainar-g ainar-g removed this from the v0.107.29 milestone Apr 12, 2023
@ainar-g ainar-g added this to the v0.107.28 milestone Apr 12, 2023
@fernvenue
Copy link
Contributor

Hi, I'm using this feature right now, but I just found out that we can just set single IP address here, is there any solution to use custom EDNS for both IPv4 and IPv6 addresses?

@rapdodge
Copy link

rapdodge commented May 7, 2023

Hi, I'm using this feature right now, but I just found out that we can just set single IP address here, is there any solution to use custom EDNS for both IPv4 and IPv6 addresses?

I'm two this...

I have v4 + v6
It's nice if there is separate ecs for v4&v6

This is if i've set the custom IPv4 address
image

This is if i've doesn't set the custom ecs ip
image

@brotaxt
Copy link

brotaxt commented Oct 6, 2024

Hi, I'm using this feature right now, but I just found out that we can just set single IP address here, is there any solution to use custom EDNS for both IPv4 and IPv6 addresses?

I'm two this...

I have v4 + v6 It's nice if there is separate ecs for v4&v6

This is if i've set the custom IPv4 address image

This is if i've doesn't set the custom ecs ip image

How can I check if ecs is working? Where does your output come from?

@rapdodge
Copy link

rapdodge commented Oct 6, 2024

Hi, I'm using this feature right now, but I just found out that we can just set single IP address here, is there any solution to use custom EDNS for both IPv4 and IPv6 addresses?

I'm two this...
I have v4 + v6 It's nice if there is separate ecs for v4&v6
This is if i've set the custom IPv4 address image
This is if i've doesn't set the custom ecs ip image

How can I check if ecs is working? Where does your output come from?

It's https://www.dnscheck.tools/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests