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

Add the option to select blocking type #40

Closed
admitrevskiy opened this issue Jan 9, 2020 · 4 comments
Closed

Add the option to select blocking type #40

admitrevskiy opened this issue Jan 9, 2020 · 4 comments
Assignees
Labels
Enhancement New feature or request
Milestone

Comments

@admitrevskiy
Copy link

Please, add ability to select blocking type by analogue with go-dnsproxy and AG Home

There are several options:

  • Default
    ||example.com^ rule should block both A and AAAA requests to example.com with NXDomain
    0.0.0.0 example.com rule should block both A and AAAA requests to example.com with unspecified ip (0.0.0.0 or [::]) response
    1.2.3.4 example.com should be used only for A requests to example.com

  • NXDomain
    ||example.com^, 0.0.0.0 example.com should block both A and AAAA requests with NXDomain

  • Unspecified IP
    ||example.com^, 0.0.0.0 example.com should block both A and AAAA requests with unspecified ip (0.0.0.0 or [::]) response

@sfionov
Copy link
Member

sfionov commented Jan 9, 2020

1.2.3.4 example.com should be used only for A requests to example.com

Current /etc/hosts logic differs, if there is any host rule with specific IP, only this set of IPs will be used to resolve both IPv4 and IPv6 addresses.

So if /etc/hosts are:

1.2.3.4 example.org

A will return 1.2.3.4
AAAA will return no addresses, request will not be forwarded.
If /etc/hosts are:

1.2.3.4 example.org
1234::5678 example.org

A will return 1.2.3.4
AAAA will return 1234::5678

I think we should use this logic for specific IPs in host rules.

@sfionov sfionov self-assigned this Jan 9, 2020
@sfionov sfionov added the Enhancement New feature or request label Jan 9, 2020
@ameshkov
Copy link
Member

Please do it as explained here:
AdguardTeam/AdGuardHome#1284 (comment)

@ameshkov ameshkov added this to the 1.1 milestone Jan 13, 2020
@sfionov
Copy link
Member

sfionov commented Jan 16, 2020

So we should threat both "0.0.0.0" and "127.0.0.1" hosts records as blocking

@sfionov sfionov assigned ngorskikh and unassigned sfionov Jan 16, 2020
@ngorskikh
Copy link
Member

dns-libs/pull-requests/60

@sfionov sfionov closed this as completed Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants