Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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] How to setup reverse DNS and add an A record #2452

Closed
3 tasks done
ghost opened this issue Dec 17, 2020 · 11 comments
Closed
3 tasks done

[Feature request] How to setup reverse DNS and add an A record #2452

ghost opened this issue Dec 17, 2020 · 11 comments
Labels

Comments

@ghost
Copy link

ghost commented Dec 17, 2020

Prerequisites

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Problem Description

How to setup reverse DNS and add an A record

@ghost ghost changed the title Feature request [Feature request] How to setup reverse DNS and add an A record Dec 17, 2020
@ameshkov
Copy link
Member

Could you please be more specific?

Reverse DNS and A records are a little bit different things

@ghost
Copy link
Author

ghost commented Dec 18, 2020

sorry,it's two functions

  1. setup reverse DNS
  2. add an A record

@ghost
Copy link
Author

ghost commented Dec 18, 2020

@ameshkov
Copy link
Member

setup reverse DNS

Not possible in the current version, but that's a good case for #2102.

@ainar-g would it be possible with $dnsrewrite in it's current implementation?

add an A record

You can use "Filters -> DNS rewrites" settings for that.

@ainar-g
Copy link
Contributor

ainar-g commented Dec 21, 2020

@ameshkov, you mean, the Reverse DNS part? Not currently, but overall the extension seems to be trivial. Maybe for v0.106.0? We have enough on our plate for v0.105.0 currently.

@ameshkov
Copy link
Member

@ainar-g why can't I add 192.168.0.1.in-addr.arpa$dnsrewrite=NOERROR:PTR:hostname?

@ainar-g
Copy link
Contributor

ainar-g commented Dec 21, 2020

@ameshkov, because different record types have different types of values, and we decode them into RRValues correspondingly. And we also need to catch the CNAME exception at the same stage.

https://github.com/AdguardTeam/urlfilter/blob/d0665c13ffaaba988fd29def346ac032c7eeb4bd/rules/dnsrewrite.go#L129-L168

We could just put the value as verbatim text in the default case, but that means that when we do decode the value properly in the future, we may break some clients.

@ameshkov
Copy link
Member

@ainar-g it should be explained in the documentation that some RRTypes don't support values yet.

There're some that are rather important and would be useful to have in the first release:

  • HTTPS - this record type may be really useful. For instance, people may use it to achieve "HTTPS everywhere"-like behavior.
  • PTR - for configuring hostnames on the network. May also be useful to setup bonjour-like services.
  • MX - for configuring mail servers on the network.

Please check how complicated is it to add those.

@ainar-g
Copy link
Contributor

ainar-g commented Dec 21, 2020

@ameshkov, PTR looks easy enough. Do we need an ability to set MX's PREFERENCE parameter? If no, also easy; if yes, medium-easy, once we agree on a format.

As far as I can see, HTTPS is basically the same as SVCB, so we could technically get both in one go. Again, we need to agree on the syntax first. After that, the difficulty seems to be medium.

@ameshkov
Copy link
Member

ameshkov commented Dec 21, 2020

Here's how I suggest to deal with MX:

|google.com^$dnsrewrite=NOERROR:MX:30 alt2.aspmx.l.google.com.

;; ANSWER SECTION:
google.com.		187	IN	MX	30 alt2.aspmx.l.google.com.

No complicated stuff is needed.

adguard pushed a commit to AdguardTeam/urlfilter that referenced this issue Dec 22, 2020
Merge in DNS/urlfilter from 2102-dnsrewrite-2 to master

Updates AdguardTeam/AdGuardHome#2102.
Updates AdguardTeam/AdGuardHome#2452.

Squashed commit of the following:

commit bc2d41b
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Dec 22 14:32:26 2020 +0300

    all: handle ptr, mx, https, and svcb dns rewrites
adguard pushed a commit that referenced this issue Dec 23, 2020
Merge in DNS/adguard-home from 2102-dnsrewrite-2 to master

Updates #2102.
Updates #2452.

Squashed commit of the following:

commit b41e577
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Dec 22 20:40:56 2020 +0300

    dnsforward: improve naming

commit 70b832c
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Dec 22 19:36:21 2020 +0300

    all: support more $dnsrewrite rr types
@ainar-g
Copy link
Contributor

ainar-g commented Dec 24, 2020

Should be possible as of v0.105.0-beta.2. @da-gongren, can you please update and check?

Wiki docs.

@AdguardTeam AdguardTeam locked and limited conversation to collaborators Feb 23, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants